<Window x:Class="TwoCamWPF.MainWindow"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       
        xmlns:mcl="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"  
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         Title="MainWindow" Height="439" Width="620"  Closing="Window_Closing" 
          xmlns:my="clr-namespace:TwoCamWPF.MainForm"
       
        >
    <!---->
    <Window.Style>
        <Style TargetType="{x:Type Window}">
            <Style.Triggers>
                <DataTrigger  Binding="{Binding RunCollapsed}"  Value="True">
                    <Setter Property="WindowState" Value="Minimized"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding RunCollapsed}" Value="False" >
                    <Setter Property="WindowState" Value="Normal"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </Window.Style>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="271*" />
            <RowDefinition Height="40*" />
        </Grid.RowDefinitions>
        <Border Grid.Row="1"  BorderBrush="Silver" BorderThickness="2">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="286*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Column="1" Orientation="Horizontal" FlowDirection="RightToLeft">
                    <Button Content="Выход" Name="button1" Click="button1_Click"  Margin="5" Width="70" />
                    <Button Content="Настройки"  Margin="5" Name="button2" Width="70" Click="button2_Click" />
                    <Button Content="Остановить" Name="button3" Width="70" Margin="5" Click="button3_Click" 
                            
                            >
                        <Button.Style>
                            <Style TargetType="{x:Type Button}">
                                <Style.Triggers>
                                    <DataTrigger  Binding="{Binding IsRecording}"  Value="True">
                                        <Setter Property="Visibility" Value="Visible"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding IsRecording}" Value="False" >
                                        <Setter Property="Visibility" Value="Collapsed"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Button.Style>

                    </Button>

                    <Button Content="Запись" Name="button4" Width="70" Margin="5" Click="button4_Click" >
                        <Button.Style>
                            <Style TargetType="{x:Type Button}">
                                <Style.Triggers>
                                    <DataTrigger  Binding="{Binding IsRecording}"  Value="True">
                                        <Setter Property="Visibility" Value="Collapsed"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding IsRecording}" Value="False" >
                                        <Setter Property="Visibility" Value="Visible"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Button.Style>
                    </Button>

                    <Button Content="Архив" Name="button5" Width="70" Margin="5" Click="button5_Click" />
                    <Button Content="Сохранить" Name="button6" Width="70" Margin="5" Visibility="Collapsed" />
                </StackPanel>
                <TextBlock Name="txtInfo" Text="TextBlock" />
            </Grid>
        </Border>
        <Grid Name="grid1" Margin="0,0,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="64*" />
                <ColumnDefinition Width="417*" />
            </Grid.ColumnDefinitions>
            <Thumb Visibility="Visible" Cursor="Hand" Name="thumb1" DragDelta="thumb1_DragDelta" DragStarted="thumb1_DragStarted" Grid.Column="1" DragCompleted="thumb1_DragCompleted"></Thumb>

            <GridSplitter Name="gridSplitter1" Grid.Column="1" HorizontalAlignment="Left" Width="5">

            </GridSplitter>

            <Image
                       Name="planImg" Stretch="Uniform" Grid.Column="1" />
            <my:LeftPanelPreview  x:Name="prewpanel" />
        </Grid>
    </Grid>
</Window>
