Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Window x:Class="StudentsWPF.MainWindow"
- 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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:StudentsWPF"
- mc:Ignorable="d"
- Title="Students" Height="350" Width="525">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition Width="100" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="30"/>
- <!-- загрузить -->
- <RowDefinition Height="30"/>
- <!-- добавить -->
- <RowDefinition Height="30"/>
- <!-- удалить -->
- <RowDefinition Height="30"/>
- <!-- редактировать -->
- <RowDefinition />
- </Grid.RowDefinitions>
- <Button Content="Load" Margin="5" Grid.Column="1" Grid.Row="0" />
- <Button Content="Add" Margin="5" Grid.Column="1" Grid.Row="1" />
- <Button Content="Delete" Margin="5" Grid.Column="1" Grid.Row="2" />
- <Button Content="Edit" Margin="5" Grid.Column="1" Grid.Row="3" />
- <ListBox Margin="5" Grid.Column="0" Grid.RowSpan="5" ItemsSource="{Binding StudentsObservableCollection}" SelectedItem="{Binding CurrentStudent}">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="30"/>
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition />
- </Grid.RowDefinitions>
- <CheckBox Margin="2" Grid.Column="0" Grid.RowSpan="2" />
- <TextBlock Margin="2" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="0">
- <StackPanel Orientation="Horizontal">
- <TextBox BorderBrush="White" Text="{Binding FirstName}" />
- <TextBlock Text=" " />
- <TextBox BorderBrush="White" Text="{Binding LastName}" />
- </StackPanel>
- </TextBlock>
- <TextBlock Margin="2" Grid.Column="1" Grid.Row="1">
- <StackPanel Orientation="Horizontal">
- <TextBlock Text ="Age: " />
- <TextBox BorderBrush="White" Text ="{Binding Age}" />
- </StackPanel>
- </TextBlock>
- <TextBlock Margin="2" Grid.Column="2" Grid.Row="1">
- <StackPanel Orientation="Horizontal">
- <TextBlock Text ="Gender: " />
- <!--<TextBox BorderBrush="White" Text ="{Binding Gender}" /> -->
- <ComboBox ItemsSource="{Binding StudentGenderObservableCollection}" SelectedIndex="{Binding Gender}" />
- </StackPanel>
- </TextBlock>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- <TextBox Margin="5" Height="30" VerticalAlignment="Top" Grid.Column="1" Grid.Row="4" />
- <ComboBox ItemsSource="{Binding StudentGenderObservableCollection}" SelectedIndex="0" />
- </Grid>
- </Window>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement