|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <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"
- Command="{Binding AddCommand}"
- Content="添加数据记录" />
- <Button
- Margin="5,0"
- Click="Button_Click_1"
- Content="保存数据记录" />
- </StackPanel>
- </Grid>
-
- <DataGrid
- Grid.Row="1"
- AutoGenerateColumns="True"
- ItemsSource="{Binding dataTests}">
- <DataGrid.Columns>
- <DataGridTemplateColumn>
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate />
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- </DataGrid.Columns>
- </DataGrid>
-
- </Grid>
- </Window>
|