Using data binding
When building graphical user interfaces, you will often want to bind a property of one control to another, or to some data.
Binding to elements
The simplest type of binding is between elements.
- In
MainPage.xaml
, after the second horizontal stack panel and inside the outer vertical stack panel, add a text block for instructions, a slider for selecting a rotation, a grid containing stack panel and text blocks to show the selected rotation in degrees, a radial gauge from the UWP Community Toolkit, and a red square to rotate, as shown highlighted in the following markup:<kit:MarkdownTextBlock Margin="5" Text="{Binding ElementName=markdownSource, Path=Text}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" /> </StackPanel> <TextBlock Grid.ColumnSpan="2" Margin="10"> Use the slider to rotate the square: </TextBlock>...