Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.79 KB | None | 0 0
  1. <Window x:Class="StudentsWPF.MainWindow"
  2.         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3.         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4.         xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5.         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6.         xmlns:local="clr-namespace:StudentsWPF"
  7.         mc:Ignorable="d"
  8.         Title="Students" Height="350" Width="525">
  9.     <Grid>
  10.         <Grid.ColumnDefinitions>
  11.             <ColumnDefinition />
  12.             <ColumnDefinition Width="100" />
  13.         </Grid.ColumnDefinitions>
  14.         <Grid.RowDefinitions>
  15.             <RowDefinition Height="30"/>
  16.             <!-- загрузить -->
  17.             <RowDefinition Height="30"/>
  18.             <!-- добавить -->
  19.             <RowDefinition Height="30"/>
  20.             <!-- удалить -->
  21.             <RowDefinition Height="30"/>
  22.             <!-- редактировать -->
  23.             <RowDefinition />
  24.         </Grid.RowDefinitions>
  25.         <Button Content="Load" Margin="5" Grid.Column="1" Grid.Row="0" />
  26.         <Button Content="Add" Margin="5" Grid.Column="1" Grid.Row="1" />
  27.         <Button Content="Delete" Margin="5" Grid.Column="1" Grid.Row="2" />
  28.         <Button Content="Edit" Margin="5" Grid.Column="1" Grid.Row="3" />
  29.         <ListBox Margin="5" Grid.Column="0" Grid.RowSpan="5" ItemsSource="{Binding StudentsObservableCollection}" SelectedItem="{Binding CurrentStudent}">
  30.             <ListBox.ItemTemplate>
  31.                 <DataTemplate>
  32.                     <Grid>
  33.                         <Grid.ColumnDefinitions>
  34.                             <ColumnDefinition Width="30"/>
  35.                             <ColumnDefinition />
  36.                             <ColumnDefinition />
  37.                         </Grid.ColumnDefinitions>
  38.                         <Grid.RowDefinitions>
  39.                             <RowDefinition />
  40.                             <RowDefinition />
  41.                         </Grid.RowDefinitions>
  42.                         <CheckBox Margin="2" Grid.Column="0" Grid.RowSpan="2" />
  43.                         <TextBlock Margin="2" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="0">
  44.                             <StackPanel Orientation="Horizontal">                                
  45.                                 <TextBox BorderBrush="White" Text="{Binding FirstName}" />
  46.                                 <TextBlock Text=" " />
  47.                                 <TextBox BorderBrush="White" Text="{Binding LastName}" />
  48.                             </StackPanel>
  49.                         </TextBlock>
  50.                         <TextBlock Margin="2" Grid.Column="1" Grid.Row="1">
  51.                             <StackPanel Orientation="Horizontal">
  52.                                 <TextBlock Text ="Age: " />
  53.                                 <TextBox BorderBrush="White" Text ="{Binding Age}" />
  54.                             </StackPanel>
  55.                         </TextBlock>
  56.                         <TextBlock Margin="2" Grid.Column="2" Grid.Row="1">
  57.                             <StackPanel Orientation="Horizontal">
  58.                                 <TextBlock Text ="Gender: " />
  59.                                 <!--<TextBox BorderBrush="White" Text ="{Binding Gender}" /> -->
  60.                                 <ComboBox ItemsSource="{Binding StudentGenderObservableCollection}" SelectedIndex="{Binding Gender}" />
  61.                             </StackPanel>
  62.                         </TextBlock>
  63.                     </Grid>
  64.                 </DataTemplate>
  65.             </ListBox.ItemTemplate>
  66.         </ListBox>
  67.         <TextBox Margin="5" Height="30" VerticalAlignment="Top" Grid.Column="1" Grid.Row="4" />
  68.         <ComboBox ItemsSource="{Binding StudentGenderObservableCollection}" SelectedIndex="0" />
  69.     </Grid>
  70. </Window>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement