To begin with the value converter, perform the following steps:
- From the Solution Explorer, open the MainWindow.xaml file.
- Replace the existing Grid with the following XAML markup, which contains a CheckBox and a Rectangle inside a StackPanel:
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="20"> <CheckBox x:Name="chkBox" Content="Show/Hide Box"/> <Rectangle Fill="Red" Margin="80 0 0 0" Width="150" Height="50" Visibility="{Binding IsChecked, ElementName=chkBox}"/> </StackPanel>
- There is a data binding between the Visibility property of the Rectangle and the IsChecked property of the CheckBox control. If you build and run the application, you will see that there exists no visible change in the UI when you change the checked...