<Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource Locator}, Path=CustomerViewModel}">
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Margin="20,0,0,0" VerticalAlignment="Center" Orientation="Horizontal">
<Label Content="新客户:"/>
<TextBox TextWrapping="Wrap" Width="142" Margin="0,0,10,0" Name="txt_name" />
<Label Content="客户类型:"/>
<ComboBox Width="120" Margin="0,0,20,0" Name="comb_type" ItemsSource="{Binding GetCustomType,Mode=OneWay}" DisplayMemberPath="Name" SelectedValuePath="Id" />
<Button Content="添 加" Width="75" Name="bt_add" />
</StackPanel>
<DataGrid Margin="0" Grid.Row="1" Name="dg_list" ItemsSource="{Binding GetCustomers}" AutoGenerateColumns="False" IsReadOnly="True" >
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Id,Mode=OneWay}" Header="编号" Visibility="Hidden"/>
<DataGridTextColumn Binding="{Binding Name,Mode=OneWay}" Header="客户名称" Width="100"/>
<DataGridTextColumn Binding="{Binding CustomType.Name,Mode=OneWay}" Header="客户类型" Width="150"/>
<DataGridTextColumn Binding="{Binding CreateTime.Date, Mode=OneWay}" Header="创建时间"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Margin="20,0,0,0" VerticalAlignment="Center" Orientation="Horizontal">
<Label Content="新客户:"/>
<TextBox TextWrapping="Wrap" Width="142" Margin="0,0,10,0" Name="txt_name" />
<Label Content="客户类型:"/>
<ComboBox Width="120" Margin="0,0,20,0" Name="comb_type" ItemsSource="{Binding GetCustomType,Mode=OneWay}" DisplayMemberPath="Name" SelectedValuePath="Id" />
<Button Content="添 加" Width="75" Name="bt_add" />
</StackPanel>
<DataGrid Margin="0" Grid.Row="1" Name="dg_list" ItemsSource="{Binding GetCustomers}" AutoGenerateColumns="False" IsReadOnly="True" >
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Id,Mode=OneWay}" Header="编号" Visibility="Hidden"/>
<DataGridTextColumn Binding="{Binding Name,Mode=OneWay}" Header="客户名称" Width="100"/>
<DataGridTextColumn Binding="{Binding CustomType.Name,Mode=OneWay}" Header="客户类型" Width="150"/>
<DataGridTextColumn Binding="{Binding CreateTime.Date, Mode=OneWay}" Header="创建时间"/>
</DataGrid.Columns>
</DataGrid>
</Grid>