Files
WPF_Practice/PacticeSolution/CommandSample/MainWindow.xaml

21 lines
852 B
Plaintext
Raw Normal View History

2023-08-03 11:59:30 +09:00
<Window x:Class="CommandSample.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:CommandSample"
xmlns:vm="clr-namespace:CommandSample.ViewModels"
mc:Ignorable="d"
Title="MainWindow" Height="300" Width="300">
<Window.DataContext>
<vm:MessageViewModel/>
</Window.DataContext>
<StackPanel>
<TextBox x:Name="tbMain"/>
<Button Content="Click"
Command="{Binding DisplayMessageCommand}"
CommandParameter="{Binding ElementName=tbMain, Path=Text}"/>
</StackPanel>
</Window>