Загрузка данных


<Window x:Class="StudentProfile.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Профиль студента"
        Height="520"
        Width="850"
        WindowStartupLocation="CenterScreen">

    <Grid Margin="25">

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="20"/>
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>

        <Border Grid.Column="0"
                Padding="20"
                CornerRadius="10"
                BorderBrush="LightGray"
                BorderThickness="1">

            <StackPanel>

                <TextBlock Text="Редактирование"
                           FontSize="22"
                           FontWeight="Bold"
                           Margin="0,0,0,20"/>

                <TextBlock Text="Фамилия"/>
                <TextBox Text="{Binding LastName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         Margin="0,5,0,12"/>

                <TextBlock Text="Имя"/>
                <TextBox Text="{Binding FirstName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         Margin="0,5,0,12"/>

                <TextBlock Text="Возраст"/>
                <TextBox Text="{Binding Age, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         Margin="0,5,0,12"/>

                <TextBlock Text="Группа"/>
                <ComboBox SelectedValue="{Binding Group, Mode=TwoWay}"
                          Margin="0,5,0,12">
                    <ComboBoxItem Content="ИСП-21"/>
                    <ComboBoxItem Content="ИСП-22"/>
                    <ComboBoxItem Content="ИСП-23"/>
                </ComboBox>

                <TextBlock Text="Специальность"/>
                <TextBox Text="{Binding Specialty, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         Margin="0,5,0,12"/>

                <CheckBox Content="Получает стипендию"
                          IsChecked="{Binding HasScholarship, Mode=TwoWay}"
                          Margin="0,5,0,20"/>

                <Button Content="Очистить"
                        Height="35"
                        Click="ClearButton_Click"/>

            </StackPanel>
        </Border>


        <Border Grid.Column="2"
                Padding="25"
                CornerRadius="10"
                BorderBrush="LightGray"
                BorderThickness="1">

            <StackPanel>

                <TextBlock Text="Информация о студенте"
                           FontSize="22"
                           FontWeight="Bold"
                           Margin="0,0,0,25"/>

                <TextBlock Text="ФИО"
                           FontWeight="Bold"/>

                <TextBlock FontSize="20"
                           Margin="0,5,0,20">
                    <Run Text="{Binding LastName}"/>
                    <Run Text=" "/>
                    <Run Text="{Binding FirstName}"/>
                </TextBlock>

                <TextBlock FontWeight="Bold"
                           Text="Группа"/>

                <TextBlock Text="{Binding Group}"
                           FontSize="18"
                           Margin="0,5,0,20"/>

                <TextBlock FontWeight="Bold"
                           Text="Возраст"/>

                <TextBlock Text="{Binding Age}"
                           FontSize="18"
                           Margin="0,5,0,20"/>

                <TextBlock FontWeight="Bold"
                           Text="Специальность"/>

                <TextBlock Text="{Binding Specialty}"
                           FontSize="18"
                           Margin="0,5,0,20"/>

                <TextBlock FontWeight="Bold"
                           Text="Стипендия"/>

                <TextBlock FontSize="18"
                           Margin="0,5,0,0">
                    <TextBlock.Style>
                        <Style TargetType="TextBlock">
                            <Setter Property="Text" Value="Не получает"/>

                            <Style.Triggers>
                                <DataTrigger Binding="{Binding HasScholarship}"
                                             Value="True">
                                    <Setter Property="Text"
                                            Value="Получает"/>
                                </DataTrigger>
                            </Style.Triggers>

                        </Style>
                    </TextBlock.Style>
                </TextBlock>

            </StackPanel>
        </Border>

    </Grid>

</Window>