I have ListView with one column that contains checkboxes
<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>
How can I disable checkboxes from code?
Is it possible to do that with something like: window1.checkBox1.IsEnabled = false; ?