Perform the following steps to create a dependency property, bind it to the UI, and send notifications from the code:
- From Solution Explorer, open the MainWindow.xaml page and use the same UI design that we have used in the previous example. Copy the following XAML markup and replace the content of the MainWindow.xaml file:
<Window x:Class="CH04.DependencyPropertyDemo.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="window" Title="Dependency Properties Demo" Height="150"
Width="300"> <Grid Margin="10"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="15"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions...