|
|
|
|
<Window x:Class="SimpleDataBinding.MainWindow"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
xmlns:local="clr-namespace:SimpleDataBinding"
|
|
|
|
|
mc:Ignorable="d"
|
|
|
|
|
Title="MainWindow" Height="400" Width="300">
|
|
|
|
|
|
|
|
|
|
<StackPanel Orientation="Vertical" Margin="20">
|
|
|
|
|
<StackPanel>
|
|
|
|
|
<StackPanel.DataContext>
|
|
|
|
|
<local:Cities/>
|
|
|
|
|
</StackPanel.DataContext>
|
|
|
|
|
|
|
|
|
|
<TextBlock HorizontalAlignment="Center" FontSize="20" FontWeight="Bold" Margin="0 0 0 20"
|
|
|
|
|
Text="Which city do you love?"/>
|
|
|
|
|
<CheckBox Content="SEOUL" IsChecked="{Binding Seoul}"/>
|
|
|
|
|
<CheckBox Content="JEJOO" IsChecked="{Binding Jejoo}"/>
|
|
|
|
|
<CheckBox Content="INCHEON" IsChecked="{Binding Incheon}"/>
|
|
|
|
|
<Button VerticalAlignment="Center" HorizontalAlignment="Center"
|
|
|
|
|
Content="Submit"
|
|
|
|
|
Click="Button_Click"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
|
|
<StackPanel>
|
|
|
|
|
<TextBlock HorizontalAlignment="Center" FontSize="15" FontWeight="Bold" Margin="0 0 0 20"
|
|
|
|
|
Text="Bellow is one way binding sample"/>
|
|
|
|
|
<TextBox x:Name="tb1" Text="{Binding Mode=OneWay}"/>
|
|
|
|
|
<TextBox x:Name="tb2" Text="{Binding ElementName=tb1, Path=Text}"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</Window>
|