终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TestData.xaml 1.5 KiB

2 年之前
2 年之前
2 年之前
2 年之前
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <Window
  2. x:Class="WPFDemo.TestData"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:WPFDemo"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. Title="TestData"
  9. Width="800"
  10. Height="450"
  11. mc:Ignorable="d">
  12. <Window.DataContext>
  13. <local:Class1 />
  14. </Window.DataContext>
  15. <Grid>
  16. <Grid.RowDefinitions>
  17. <RowDefinition Height="40" />
  18. <RowDefinition />
  19. </Grid.RowDefinitions>
  20. <Grid>
  21. <StackPanel Orientation="Horizontal">
  22. <Button
  23. Margin="5,0"
  24. Command="{Binding AddCommand}"
  25. Content="添加数据记录" />
  26. <Button
  27. Margin="5,0"
  28. Click="Button_Click_1"
  29. Content="保存数据记录" />
  30. </StackPanel>
  31. </Grid>
  32. <DataGrid
  33. Grid.Row="1"
  34. AutoGenerateColumns="True"
  35. ItemsSource="{Binding dataTests}">
  36. <DataGrid.Columns>
  37. <DataGridTemplateColumn>
  38. <DataGridTemplateColumn.CellTemplate>
  39. <DataTemplate />
  40. </DataGridTemplateColumn.CellTemplate>
  41. </DataGridTemplateColumn>
  42. </DataGrid.Columns>
  43. </DataGrid>
  44. </Grid>
  45. </Window>