<Window x:Class="WPF控件_4_标签.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:WPF控件_4_标签"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <StackPanel>
        <Label Target="{Binding ElementName=TextA}">LabelA</Label>
        <TextBox Name="TextA"></TextBox>
        
        <Label Target="{Binding ElementName=TExtB}">LabelB</Label>
        <TextBox Name="TExtB"></TextBox>

       <DockPanel HorizontalAlignment="Left">
           <Button IsCancel="True" Click="ButtonBase_OnClick">取消按钮-按下esc键会触发</Button>
           <Button IsDefault="True" Name="Confirm" Click="Confirm_OnClick">确认按钮-按下回车键会触发</Button>
       </DockPanel>
    </StackPanel>
</Window>
