|
1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <Window
- x:Class="WPFDemo.TestData"
- 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:local="clr-namespace:WPFDemo"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-
- Title="TestData"
- Width="800"
- Height="450"
- mc:Ignorable="d">
-
- <Window.DataContext>
- <local:Class1/>
- </Window.DataContext>
-
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="40" />
- <RowDefinition />
- </Grid.RowDefinitions>
-
- <Grid>
- <StackPanel Orientation="Horizontal">
- <Button Margin="5,0" Content="添加数据记录" Command="{Binding AddCommand}"/>
- <Button Margin="5,0" Content="保存数据记录" Click="Button_Click_1"/>
- </StackPanel>
- </Grid>
-
- <DataGrid Grid.Row="1" AutoGenerateColumns="True" ItemsSource="{Binding dataTests}" >
- <DataGrid.Columns>
- <DataGridTemplateColumn>
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
-
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- </DataGrid.Columns>
- </DataGrid>
-
- </Grid>
- </Window>
|