vue-java-tutorials/CSharp/WPFTutorial/WPF-8- DataBindings/MainWindow.xaml

23 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2025-06-22 20:21:42 +08:00
<Window x:Class="WPF_8__DataBindings.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"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBox Grid.Row="0" Name="InputTextBox" VerticalContentAlignment="Center" Width="250" Height="40"
FontSize="16" Text="{Binding BoundText,UpdateSourceTrigger=PropertyChanged,Mode=Default}" />
<Button Grid.Row="1" Name="SetButton" Content="Set" Width="100" Height="40" Click="SetButton_OnClick" />
<TextBlock Grid.Row="2" Name="ResulTextBlock" FontSize="16" Text="{Binding BoundText}"
VerticalAlignment="Center" HorizontalAlignment="Center" />
</Grid>
</Window>