For this example we will start off with a Windows Application (WPF). In the forms XMAL we will add a stack panel to hold a label and scrollbar. The label's content will be bound to the scrollbar's value so as we move the scrollbar the value will be displayed in the label.
In the Lets set up a DataContext which is bound to the scrollbar .
Now we can bind the label's content to the scrollbars value
Content="{Binding Path=Value}" />
The complete XMAL for the Window
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="WPFOneWayBind" Height="300" Width="300"
>
Content="{Binding Path=Value}" />
No comments:
Post a Comment