终端一体化运控平台
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

45 linhas
1.4 KiB

  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 Margin="5,0" Content="添加数据记录" Command="{Binding AddCommand}"/>
  23. <Button Margin="5,0" Content="保存数据记录" Click="Button_Click_1"/>
  24. </StackPanel>
  25. </Grid>
  26. <DataGrid Grid.Row="1" AutoGenerateColumns="True" ItemsSource="{Binding dataTests}" >
  27. <DataGrid.Columns>
  28. <DataGridTemplateColumn>
  29. <DataGridTemplateColumn.CellTemplate>
  30. <DataTemplate>
  31. </DataTemplate>
  32. </DataGridTemplateColumn.CellTemplate>
  33. </DataGridTemplateColumn>
  34. </DataGrid.Columns>
  35. </DataGrid>
  36. </Grid>
  37. </Window>