【发布时间】:2020-06-22 15:49:35
【问题描述】:
I have a screen in WPF like that (WPF MVVM C#)I want to when I clicked the generate reports button.All of other functions will be disable.(without button)
我该怎么做?我等待你的想法(就像在网格中)我可以像所有这些绑定 IsEnabled 一样做到这一点。但我不想那样做。
<CheckBox x:Name="IncludeEmployeesCheckBox" Content="Include All Employees" IsChecked="{Binding IncludeAllEmployees, Mode=TwoWay}" Margin="4" />
<CheckBox Content="Exclude Weekends" IsChecked="{Binding ExcludeWeekends}" Margin="4" />
<CheckBox Content="Exclude Former Employees" IsChecked="{Binding ExcludeFormerEmployees}" Margin="4" />
<CheckBox Content="Exclude Public Holidays" IsChecked="{Binding ExcludePublicHolidays}" Margin="4" />
<Button Content="Generate Reports" Command="{Binding GenerateReportsCommand}" Height="36" Margin="4" />
感谢您的所有帮助。
【问题讨论】:
-
将所有这些控件包装在面板中并将 isEnabled 绑定到禁用属性。