<Window x:Class="t8_elements.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:t8_elements"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition
                Width="5*"/>
            <ColumnDefinition
                Width="11*"/>
            <ColumnDefinition Width="4*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition
                Height="1.4*"/>
            <RowDefinition
                Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel
            HorizontalAlignment="Center"
            Width="150"
            Grid.RowSpan="2">
            <Button 
            x:Name="acceptButton" 
            Content="ОК" 
            IsDefault="True"
            Margin="0 3 0 0"
            Click="acceptButton_Click" />
            <Button 
            x:Name="escButton" 
            Content="Выход" 
            IsCancel="True" 
            Click="escButton_Click" />
            <CheckBox
                x:Name="checkBox"
                IsChecked="False"
                Height="20"
                HorizontalAlignment="Center"
                VerticalContentAlignment="Center"
                Content="Флажок"
                IsThreeState="True"
                Unchecked="checkBox_Unchecked"
                Checked="checkBox_Checked"
                Indeterminate="checkBox_Indeterminate"
                />
            <RadioButton 
                GroupName="Languages" 
                Content="C#" 
                IsChecked="False" />
            <RadioButton 
                GroupName="Languages"
                Checked="RadioButton_Checked"
                Content="VB.NET" />
            <RadioButton 
                GroupName="Languages" 
                Content="C++" />
            <RadioButton 
                GroupName="Technologies" 
                Content="WPF" 
                IsChecked="False" />
            <RadioButton 
                GroupName="Technologies" 
                Content="WinForms" />
            <RadioButton 
                GroupName="Technologies" 
                Content="ASP.NET" />
            <TextBox 
                MaxLength="250"
                Margin="5">
                Начальный текст
            </TextBox>
            <TextBox
                x:Name="textBox1"
                AcceptsReturn="True" 
                SpellCheck.IsEnabled="True"
                Language="ru-ru"
                Height="60"
                Margin="5"
                TextWrapping="Wrap"
                VerticalScrollBarVisibility="Auto"
                HorizontalScrollBarVisibility="Auto">
                Начальный текст
            </TextBox>
            <Button
                    Content="Выделить текст"
                    Height="30"
                    Width="100"
                    Click="Button_Click"
                    Margin="5"/>
            <Label 
                Target="{Binding ElementName=TextBox1}">
                _Привет
            </Label>
            <TextBox 
                Name="TextBox1" 
                Height="20" 
                Width="100" />
            <PasswordBox 
                 PasswordChar="*" 
                 MinHeight="10"
                 Margin="0 3 0 0"/>
            <PasswordBox 
                MinHeight="10" />
        </StackPanel>
        <StackPanel
            Grid.Column="1" Grid.ColumnSpan="2">
            <ListBox 
                Name="list"
                Width="150"
                Margin="0 5 0 0"
                DisplayMemberPath="Title"
                SelectionChanged="list_Selected">
                <local:Phone
                    Title="iPhone6S"
                    Company="Apple"
                    Price="54990"/>
                <local:Phone 
                    Title="Lumia 950" 
                    Company="Microsoft" 
                    Price="39990" />
                <local:Phone 
                    Title="Nexus 5X" 
                    Company="Google" 
                    Price="29990" />
            </ListBox>

            <ComboBox 
                Height="80" 
                Width="170"
                Margin=" 0 5 0 0"
                VerticalAlignment="Top">
                <ComboBoxItem IsSelected="True">
                    <StackPanel Orientation="Horizontal">
                        <Image 
                        Source="nagiev1.jpg"
                        Width="60"
                        Height="80"/>
                        <TextBlock>первый нагиев</TextBlock>
                    </StackPanel>
                </ComboBoxItem>
                <StackPanel Orientation="Horizontal">
                    <Image 
                        Source="nagiev2.jpg"
                        Width="60"
                        Height="80"/>
                    <TextBlock>второй нагиев</TextBlock>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Image 
                        Source="nagiev3.jpg" 
                        Width="60"
                        Height="80"/>
                    <TextBlock>третий нагиев</TextBlock>
                </StackPanel>
            </ComboBox>

            <DataGrid 
                x:Name="phonesGrid"
                Margin="0 5 0 0"
                AutoGenerateColumns="False"
                HorizontalGridLinesBrush="DarkGray"
                RowBackground="LightGray"
                AlternatingRowBackground="White"
                MaxWidth="228">
                <DataGrid.Items>
                    <local:Phone 
                    Title="iPhone 6S" 
                    Company="Apple" 
                    Price="54990" />
                    <local:Phone 
                    Title="Lumia 950" 
                    Company="Microsoft" 
                    Price="39990" />
                    <local:Phone 
                    Title="Nexus 5X" 
                    Company="Google" 
                    Price="29990" />
                </DataGrid.Items>
                <DataGrid.Columns>
                    <DataGridTextColumn 
                    Header="Модель" 
                    Binding="{Binding Path=Title}" 
                    Width="90" />
                    <DataGridHyperlinkColumn 
                    Header="Компания" 
                    Binding="{Binding Path=Company}" 
                    Width="80" />
                    <DataGridTextColumn 
                    Header="Цена" 
                    Binding="{Binding Path=Price}" 
                    Width ="50" />
                </DataGrid.Columns>

                <DataGrid.RowDetailsTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock
                                Text="{Binding Path=Price}"/>
                            <TextBlock
                                Text=" рублей по скидке"/>
                        </StackPanel>
                    </DataTemplate>
                </DataGrid.RowDetailsTemplate>
            </DataGrid>
        </StackPanel>
        <Grid
            Grid.Column="1"
            Background="Bisque" Grid.ColumnSpan="2" Margin="0,253,0,0" Grid.RowSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition
                    Width="0.5*"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Image Grid.Column="0" x:Name="mainNagiev">
                <Image.Source>
                    <FormatConvertedBitmap Source="nagiev1.jpg"
                        DestinationFormat="Gray32Float"/>
                </Image.Source>
            </Image>
            <StackPanel Grid.Column="1">
                <Image Source="nagiev3.jpg"/>
            </StackPanel>
        </Grid>
    </Grid>
</Window>
