Created
March 21, 2015 19:47
-
-
Save Patrick84/24996627898927cee831 to your computer and use it in GitHub Desktop.
Two Textboxes bound to each other in XAML. If the Text of the first Textbox is changed, the second one will also change.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="BindingExample.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="MainWindow" Height="350" Width="525"> | |
<Grid> | |
<TextBox x:Name="tb1" HorizontalAlignment="Left" Height="23" Margin="102,80,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="120"/> | |
<TextBox x:Name="tb2" HorizontalAlignment="Left" Height="23" Margin="282,80,0,0" TextWrapping="Wrap" Text="{Binding Text, ElementName=tb1, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top" Width="120"/> | |
</Grid> | |
</Window> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment