MainWindow.xaml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <Window x:Class="MvvmScaffoldFrame48.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:MvvmScaffoldFrame48"
  7. mc:Ignorable="d"
  8. Title="MainWindow" Height="450" Width="800">
  9. <Grid>
  10. <StackPanel Margin="0,0,0,40">
  11. <ToolBar>
  12. <Label Content="姓名:"></Label>
  13. <TextBox Text="{Binding Name}" Width="50"></TextBox>
  14. <Label Content="邮箱:"></Label>
  15. <TextBox Text="{Binding Email}" Width="100"></TextBox>
  16. <Button Content="添加"
  17. Command="{Binding AddUserCommand }"></Button>
  18. <Button Content="测试"
  19. Command="{Binding TestCommand }"></Button>
  20. </ToolBar>
  21. <StackPanel>
  22. <DataGrid ItemsSource="{Binding Users}"></DataGrid>
  23. </StackPanel>
  24. </StackPanel>
  25. <Grid VerticalAlignment="Bottom" Height="40">
  26. <Ellipse Width="20" Height="20" Margin="48,0,0,0" >
  27. <Ellipse.Style>
  28. <Style TargetType="Ellipse">
  29. <Setter Property="Fill" Value="Red" />
  30. <Style.Triggers>
  31. <DataTrigger Binding="{Binding StaticTest}" Value="True">
  32. <Setter Property="Fill" Value="Green" />
  33. </DataTrigger>
  34. </Style.Triggers>
  35. </Style>
  36. </Ellipse.Style>
  37. </Ellipse>
  38. </Grid>
  39. </Grid>
  40. </Window>