Now perform the following steps to design the UI with a TextBlock and a Slider control. Then we will bind the value of the slider control with the FontSize property of the TextBlock:
- Open the MainWindow.xaml page and replace the default Grid panel with the following XAML markup:
<Grid> <TextBlock FontSize="{Binding Value, ElementName=fontSizeSlider}" Margin="4" HorizontalAlignment="Center" VerticalAlignment="Center"> <Run Text="Font Size:"/> <Run Text="{Binding Value, ElementName=fontSizeSlider}"/> </TextBlock> <Slider x:Name="fontSizeSlider" Minimum="10" Maximum="40" Value="20" LargeChange="5" VerticalAlignment="Bottom" Margin="10"/> </Grid>...