У меня есть ListView с одним столбцом, который содержит флажки
<ListView Height="164" HorizontalAlignment="Left" ItemsSource="{Binding ProductList}" Name="listView1" VerticalAlignment="Top">
<ListView.Resources>
<Style x:Key="DataGridCheckBox" TargetType="{x:Type CheckBox}">
<Setter Property="FrameworkElement.HorizontalAlignment" Value="Center" />
<Setter Property="Control.HorizontalContentAlignment" Value="Center" />
<Setter Property="UIElement.IsEnabled" Value="True" />
<Setter Property="FrameworkElement.Margin" Value="4" />
<Setter Property="FrameworkElement.VerticalAlignment" Value="Center" />
<Setter Property="Control.VerticalContentAlignment" Value="Center" />
</Style>
</ListView.Resources>
<ListView.View>
<GridView>
<GridViewColumn Width="40">
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox Style="{StaticResource DataGridCheckBox}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn DisplayMemberBinding="{Binding ProductName}" Header="Product Name" Width="120" />
</GridView>
</ListView.View>
</ListView>
Как я могу отключить флажки из кода?Можно ли сделать это с чем-то вроде: window1.checkBox1.IsEnabled = false;
?