<UserControl x:Class="HandBrakeWPF.Views.MainView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:HandBrakeWPF.Controls"
        xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:Micro="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
        AllowDrop="True"
        Background="#FFF0F0F0"
        FontSize="11"
        Micro:Message.Attach="[Event Loaded] = [Action Load]"
        SnapsToDevicePixels="True"
        UseLayoutRounding="True"
        >

    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Drop">
            <Micro:ActionMessage MethodName="FilesDroppedOnWindow">
                <Micro:Parameter Value="$eventArgs" />
            </Micro:ActionMessage>
        </i:EventTrigger>
    </i:Interaction.Triggers>

    <UserControl.Resources>

        <Style TargetType="Button">
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="Padding" Value="5,1" />
            <Setter Property="FontSize" Value="11.5" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="MinHeight" Value="22" />
        </Style>

        <Style x:Key="textBlockOrangeStyle" TargetType="TextBlock">
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="Padding" Value="5,5" />
        </Style>

        <CollectionViewSource x:Key="presetsCvs" Source="{Binding Presets}">
            <CollectionViewSource.GroupDescriptions>
                <PropertyGroupDescription PropertyName="Category" />
            </CollectionViewSource.GroupDescriptions>
        </CollectionViewSource>

        <Style TargetType="ListBoxItem">
            <Setter Property="Padding" Value="0,2,0,2" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsBuildIn}" Value="True">
                    <Setter Property="Foreground" Value="DarkBlue" />
                </DataTrigger>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="FontWeight" Value="Bold"/>
                    <Setter Property="Background" Value="Transparent"/>
                </Trigger>
                <DataTrigger Binding="{Binding IsDefault}" Value="True" >
                    <Setter Property="FontStyle" Value="Italic" />
                </DataTrigger>
                <DataTrigger Binding="{Binding IsDefault}" Value="False" >
                    <Setter Property="FontStyle" Value="Normal" />
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="ContainerStyle" TargetType="{x:Type GroupItem}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Expander Header="{Binding Name}" IsExpanded="True">
                            <ItemsPresenter />
                        </Expander>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />

    </UserControl.Resources>

    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <!--  Menu and Taskbar  -->
        <StackPanel Grid.Row="0"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch"
                    Orientation="Vertical"
                    >
            <!--  Main Menu  -->
            <Menu Height="23"
                  HorizontalAlignment="Stretch"
                  VerticalAlignment="Top"
                  >
                <MenuItem Header="File">
                    <MenuItem Header="Cancel Scan" Command="{Binding CancelScanCommand}" />
                    <Separator />
                    <MenuItem Header="Exit" Micro:Message.Attach="[Event Click] = [Action ExitApplication]" />
                </MenuItem>

                <MenuItem Header="Tools">
                    <MenuItem Header="Show Queue" Micro:Message.Attach="[Event Click] = [Action OpenQueueWindow]">
                        <MenuItem.Icon>
                            <Image Width="16" Source="Images/Queue_Small.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="Activity Log" Micro:Message.Attach="[Event Click] = [Action OpenLogWindow]">
                        <MenuItem.Icon>
                            <Image Width="16" Source="Images/Output_Small.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <Separator />
                    <MenuItem Header="Options" Micro:Message.Attach="[Event Click] = [Action OpenOptionsWindow]">
                        <MenuItem.Icon>
                            <Image Width="16" Source="Images/Pref_Small.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                </MenuItem>

                <MenuItem Header="Help">
                    <MenuItem Header="HandBrake User Guide (HTTP)" Micro:Message.Attach="[Event Click] = [Action LaunchHelp]">
                        <MenuItem.Icon>
                            <Image Width="16" Height="16"  Source="Images/information.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <Separator />
                    <MenuItem Header="Check for Updates" Micro:Message.Attach="[Event Click] = [Action CheckForUpdates]" />
                    <Separator />
                    <MenuItem Header="About..." Micro:Message.Attach="[Event Click] = [Action OpenAboutApplication]" />
                </MenuItem>

                <MenuItem Header="Debug" Visibility="{Binding ShowDebugMenu, Converter={StaticResource boolToVisConverter}}" >
                    <MenuItem Header="Show CLI Equiv" Micro:Message.Attach="[Event Click] = [Action ShowCliQuery]" />
                    <MenuItem Header="Debug Scan Log" Micro:Message.Attach="[Event Click] = [Action DebugScanLog]" />
                </MenuItem>
            </Menu>

            <!--  ToolBar  -->
            <ToolBar Name="mainToolBar"
                     HorizontalAlignment="Stretch"
                     VerticalAlignment="Stretch"
                     SnapsToDevicePixels="False"
                     ToolBar.OverflowMode="Never"
                     ToolBarTray.IsLocked="True"
                     >
                <Menu Background="Transparent">
                    <MenuItem ItemsSource="{Binding SourceMenu}">
                        <MenuItem.Header>
                            <StackPanel Orientation="Horizontal">
                                <Image Width="32"
                                       Height="32"
                                       Source="Images/Movies.png"
                                       />
                                <Label Margin="8,0,0,0"
                                       VerticalAlignment="Center"
                                       Content="Source"
                                       />
                            </StackPanel>
                        </MenuItem.Header>
                        <MenuItem.ItemContainerStyle>
                            <Style TargetType="{x:Type MenuItem}">
                                <Setter Property="Header" Value="{Binding Text}" />
                                <Setter Property="MenuItem.Command" Value="{Binding Command}"/>
                                <Setter Property="MenuItem.CommandParameter" Value="123"/>
                                <Setter Property="ItemsSource" Value="{Binding Children}" />
                                <Setter Property="Icon" Value="{Binding Image}" />
                            </Style>
                        </MenuItem.ItemContainerStyle>
                    </MenuItem>
                </Menu>

                <Separator />

                <Button Name="Start"
                        Micro:Message.Attach="[Event Click] = [Action StartEncode]"
                        Visibility="{Binding IsEncoding,
                                             Converter={StaticResource boolToVisConverter},
                                             ConverterParameter=true}"
                        >
                    <StackPanel Orientation="Horizontal">
                        <Image Width="32"
                               Height="32"
                               Source="Images/Play.png"
                               />
                        <Label Margin="8,0,0,0"
                               VerticalAlignment="Center"
                               Content="Start"
                               />
                    </StackPanel>
                </Button>

                <Button Name="Stop"
                        Micro:Message.Attach="[Event Click] = [Action StopEncode]"
                        Visibility="{Binding IsEncoding,
                                             Converter={StaticResource boolToVisConverter},
                                             ConverterParameter=false}"
                        >
                    <StackPanel Orientation="Horizontal">
                        <Image Width="32"
                               Height="32"
                               SnapsToDevicePixels="True"
                               Source="Images/stop.png"
                               />
                        <Label Margin="8,0,0,0"
                               VerticalAlignment="Center"
                               Content="Stop"
                               />
                    </StackPanel>
                </Button>

                <Menu Background="Transparent">
                    <MenuItem>
                        <MenuItem.Header>
                            <StackPanel Orientation="Horizontal">
                                <Button Name="QueueDrop"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Stretch"
                                        HorizontalContentAlignment="Stretch"
                                        VerticalContentAlignment="Stretch"
                                        Background="Transparent"
                                        Micro:Message.Attach="[Event Click] = [Action AddToQueue]"
                                        >
                                    <StackPanel Orientation="Horizontal">
                                        <Image Width="32"
                                               Height="32"
                                               SnapsToDevicePixels="True"
                                               Source="Images/AddToQueue_small.png"
                                               />
                                        <Label Margin="8,0,0,0"
                                               VerticalAlignment="Center"
                                               Content="Add To Queue"
                                               />
                                    </StackPanel>
                                    <Button.Style>
                                        <Style TargetType="{x:Type Button}">
                                            <Setter Property="Template">
                                                <Setter.Value>
                                                    <ControlTemplate TargetType="{x:Type Button}">
                                                        <Border x:Name="border"
                                                                Background="{TemplateBinding Background}"
                                                                SnapsToDevicePixels="True"
                                                                >
                                                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                                              Content="{TemplateBinding Content}"
                                                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                                                              />
                                                        </Border>
                                                        <ControlTemplate.Triggers>
                                                            <Trigger Property="IsPressed" Value="True">
                                                                <Setter TargetName="border" Property="Background" Value="#FF98B5E2" />
                                                            </Trigger>
                                                        </ControlTemplate.Triggers>
                                                    </ControlTemplate>
                                                </Setter.Value>
                                            </Setter>
                                        </Style>
                                    </Button.Style>
                                </Button>

                                <Path Height="5"
                                      Margin="2,2,2,0"
                                      Data="M 0 0 L 4 4 L 8 0 Z"
                                      Fill="{DynamicResource GlyphBrush}"
                                      />
                            </StackPanel>
                        </MenuItem.Header>
                        <MenuItem Header="Add All" Micro:Message.Attach="[Event Click] = [Action AddAllToQueue]" />
                        <!--<MenuItem Header="Add Selection" Micro:Message.Attach="[Event Click] = [Action AddSelectionToQueue]" />-->
                    </MenuItem>
                </Menu>

                <Button Name="ShowQueue" Micro:Message.Attach="[Event Click] = [Action OpenQueueWindow]">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="32"
                               Height="32"
                               SnapsToDevicePixels="True"
                               Source="Images/Queue_small.png"
                               />
                        <Label Margin="8,0,0,0"
                               VerticalAlignment="Center"
                               Content="Show Queue"
                               />
                    </StackPanel>
                </Button>

                <Separator />

                <Button Name="Preview" Micro:Message.Attach="[Event Click] = [Action OpenPreviewWindow]">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="32"
                               Height="32"
                               SnapsToDevicePixels="True"
                               Source="Images/picture_small.png"
                               />
                        <Label Margin="8,0,0,0"
                               VerticalAlignment="Center"
                               Content="Preview"
                               />
                    </StackPanel>
                </Button>

                <Button Name="ActivityWindow" Micro:Message.Attach="[Event Click] = [Action OpenLogWindow]">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="32"
                               Height="32"
                               Source="Images/ActivityWindow.png"
                               />
                        <Label Margin="8,0,0,0"
                               VerticalAlignment="Center"
                               Content="Activity Log"
                               />
                    </StackPanel>
                </Button>
            </ToolBar>
        </StackPanel>

        <!--  Main Body  -->
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="270" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <!--  Main Controls  -->
            <StackPanel Orientation="Vertical">
                <!--  Source  -->
                <StackPanel Margin="10,5,5,5"
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch"
                            >
                    <StackPanel Orientation="Horizontal">
                        <Label Content="Source" FontWeight="Bold" />
                        <Label Content="{Binding Path=SourceLabel}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Label Margin="8,0,0,0" Content="Title" />
                        <ComboBox Name="Titles"
                                  MinWidth="100"
                                  Margin="8,0,0,0"
                                  ItemsSource="{Binding ScannedSource.Titles}"
                                  SelectedItem="{Binding Path=SelectedTitle}"
                                  />
                        <Label Margin="8,0,0,0" Content="Angle" />
                        <ComboBox Name="Angles"
                                  MinWidth="60"
                                  Margin="8,0,0,0"
                                  ItemsSource="{Binding Angles}"
                                  SelectedItem="{Binding SelectedAngle}"
                                  />
                        <ComboBox Name="PointToPointMode"
                                  MinWidth="80"
                                  Margin="8,0,0,0"
                                  ItemsSource="{Binding RangeMode}"
                                  SelectedItem="{Binding SelectedPointToPoint}"
                                  />
                        <ComboBox Name="StartPoint"
                                  MinWidth="60"
                                  Margin="8,0,0,0"
                                  ItemsSource="{Binding StartEndRangeItems}"
                                  SelectedItem="{Binding SelectedStartPoint}"
                                  Visibility="{Binding ShowTextEntryForPointToPointMode,
                                                       Converter={StaticResource boolToVisConverter},
                                                       ConverterParameter=true}"
                                  />
                        <Controls:TimeSpanBox  Number="{Binding SelectedStartPoint, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                               Minimum="0" AllowEmpty="False" ShowTimeSpan="{Binding IsTimespanRange}"
                                               MinWidth="80" Margin="8,0,0,0"  Visibility="{Binding ShowTextEntryForPointToPointMode,
                                                       Converter={StaticResource boolToVisConverter},
                                                       ConverterParameter=false}"
                                                />
                        
                        <Label Margin="8,0,0,0" Content="through" />
                        <ComboBox Name="EndPoint"
                                  MinWidth="60"
                                  Margin="8,0,0,0"
                                  ItemsSource="{Binding StartEndRangeItems}"
                                  SelectedItem="{Binding SelectedEndPoint}"
                                  Visibility="{Binding ShowTextEntryForPointToPointMode,
                                                       Converter={StaticResource boolToVisConverter},
                                                       ConverterParameter=true}"
                                  />
                        <Controls:TimeSpanBox  Number="{Binding SelectedEndPoint, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                               Minimum="0" AllowEmpty="False" ShowTimeSpan="{Binding IsTimespanRange}"
                                               MinWidth="80" Margin="8,0,0,0"  Visibility="{Binding ShowTextEntryForPointToPointMode,
                                                       Converter={StaticResource boolToVisConverter},
                                                       ConverterParameter=false}"
                                                />
  
                        <Label Margin="8,0,0,0" Content="Duration" />
                        <Label Margin="8,0,0,0" Content="{Binding Duration}" />
                    </StackPanel>
                </StackPanel>
            </StackPanel>

            <!--  Destination  -->
            <StackPanel Grid.Row="1"
                        Margin="10,5,5,5"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"
                        >
                <Label Content="Destination" FontWeight="Bold" />
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Label Margin="8,0,0,0" Content="File" />
                    <TextBox Name="Destination"
                             Grid.Column="1"
                             Margin="8,0,0,0"
                             Text="{Binding Destination,
                                            UpdateSourceTrigger=PropertyChanged}"
                             />
                    <Button Name="DestinationBrowser"
                            Grid.Column="2"
                            Margin="8,0,0,0"
                            Content="Browse"
                            Micro:Message.Attach="[Event Click] = [Action BrowseDestination]"
                            />
                </Grid>
            </StackPanel>

            <!--  Output Options  -->
            <StackPanel Grid.Row="2"
                        Margin="10,5,5,5"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"
                        >
                <Label Content="Output Settings" FontWeight="Bold" />
                <StackPanel Orientation="Horizontal">
                    <Label Margin="8,0,0,0" Content="Container" />
                    <ComboBox Name="Container"
                              MinWidth="100"
                              Margin="8,0,0,0"
                              ItemsSource="{Binding OutputFormats}"
                              SelectedItem="{Binding SelectedOutputFormat}"
                              />
                    <CheckBox Name="LargeFileMp4"
                              Margin="8,0,0,0"
                              VerticalAlignment="Center"
                              Content="Large File Size"
                              IsChecked="{Binding Path=CurrentTask.LargeFile}"
                              Visibility="{Binding IsMkv,
                                                   Converter={StaticResource boolToVisConverter},
                                                   ConverterParameter=true}"
                              />
                    <CheckBox Name="WebOptimized"
                              Margin="8,0,0,0"
                              VerticalAlignment="Center"
                              Content="Web Optimized"
                              IsChecked="{Binding Path=CurrentTask.OptimizeMP4}"
                              Visibility="{Binding IsMkv,
                                                   Converter={StaticResource boolToVisConverter},
                                                   ConverterParameter=true}"
                              />
                    <CheckBox Name="iPod5G"
                              Margin="8,0,0,0"
                              VerticalAlignment="Center"
                              Content="iPod 5G Support"
                              IsChecked="{Binding Path=CurrentTask.IPod5GSupport}"
                              Visibility="{Binding IsMkv,
                                                   Converter={StaticResource boolToVisConverter},
                                                   ConverterParameter=true}"
                              />
                </StackPanel>
            </StackPanel>

            <!--  Tab Control  -->
            <TabControl Name="tabControl"
                        Grid.Row="3"
                        Margin="10,10,5,5"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"
                        >
                <TabItem Name="pictureTab" Header="Picture">
                    <ContentControl x:Name="PictureSettingsViewModel" />
                </TabItem>
                <TabItem Name="filtersTab" Header="Filters">
                    <ContentControl x:Name="FiltersViewModel" />
                </TabItem>
                <TabItem Name="videoTab" Header="Video">
                    <ContentControl x:Name="VideoViewModel" />
                </TabItem>
                <TabItem Name="audioTab" Header="Audio">
                    <ContentControl x:Name="AudioViewModel" />
                </TabItem>
                <TabItem Name="subtitlesTab" Header="Subtitles">
                    <ContentControl x:Name="SubtitleViewModel" />
                </TabItem>
                <TabItem Name="chaptersTab" Header="Chapters">
                    <ContentControl x:Name="ChaptersViewModel" />
                </TabItem>
                <TabItem Name="advancedTab" Header="Advanced" Visibility="{Binding ShowAdvancedTab, Converter={StaticResource boolToVisConverter}}">
                    <ContentControl x:Name="AdvancedViewModel" />
                </TabItem>
            </TabControl>

            <!--  Presets  -->
            <GroupBox Grid.RowSpan="4"
                      Grid.Column="1"
                      HorizontalAlignment="Stretch"
                      VerticalAlignment="Stretch"
                      Header="Presets"
                      Margin="0,0,0,5"
                      Background="White"
                      >
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <ListBox HorizontalAlignment="Stretch"
                             VerticalAlignment="Stretch" ItemsSource="{Binding Source={StaticResource presetsCvs}}"
                             SelectedItem="{Binding SelectedPreset, Mode=TwoWay}" BorderThickness="0,0,0,1"
                             BorderBrush="LightGray"
                            >

                        <ListBox.GroupStyle>
                            <GroupStyle ContainerStyle="{StaticResource ContainerStyle}"/>
                        </ListBox.GroupStyle>

                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Name}" Margin="24,0,0,0" Padding="8,1" />
                            </DataTemplate>
                        </ListBox.ItemTemplate>

                    </ListBox>

                    <ToolBar Name="presetsToolBar"
                             Grid.Row="1"
                             HorizontalAlignment="Center"
                             VerticalAlignment="Stretch"
                             Background="Transparent"
                             SnapsToDevicePixels="False"
                             UseLayoutRounding="False"
                             ToolBar.OverflowMode="Never" 
                             ToolBarTray.IsLocked="True"
                             Loaded="ToolBarLoaded"
                             >
                        <Button Micro:Message.Attach="[Event Click] = [Action PresetAdd]" >
                            <Button.Content>
                                <StackPanel Orientation="Horizontal">
                                    <Image Width="18"
                                           Height="18"
                                           Source="Images/add.png"
                                           />
                                    <TextBlock Margin="2,0,0,0"
                                               VerticalAlignment="Center"
                                               Style="{StaticResource textBlockOrangeStyle}"
                                               Text="Add"
                                               />
                                </StackPanel>
                            </Button.Content>
                        </Button>
                        <Button Micro:Message.Attach="[Event Click] = [Action PresetRemove]">
                            <Button.Content>
                                <StackPanel Orientation="Horizontal">
                                    <Image Width="18"
                                           Height="18"
                                           Source="Images/remove.png"
                                           />
                                    <TextBlock Margin="2,0,0,0"
                                               VerticalAlignment="Center"
                                               Style="{StaticResource textBlockOrangeStyle}"
                                               Text="Remove"
                                               />
                                </StackPanel>
                            </Button.Content>
                        </Button>
                        <Menu Background="Transparent">
                            <MenuItem ToolBar.OverflowMode="Never">
                                <MenuItem.Header>
                                    <StackPanel Orientation="Horizontal">
                                        <Image Width="20"
                                               Height="20"
                                               Source="Images/Options24.png"
                                               />
                                        <TextBlock Margin="2,0,0,0"
                                                   VerticalAlignment="Center"
                                                   Style="{StaticResource textBlockOrangeStyle}"
                                                   Text="Options"
                                                   />
                                    </StackPanel>
                                </MenuItem.Header>
                                <MenuItem Header="Set Default" Micro:Message.Attach="[Event Click] = [Action PresetSetDefault]" />
                                <Separator />
                                <MenuItem Header="Update Selected Preset" Micro:Message.Attach="[Event Click] = [Action PresetUpdate]" />
                                <Separator />
                                <MenuItem Header="Import" Micro:Message.Attach="[Event Click] = [Action PresetImport]" />
                                <MenuItem Header="Export" Micro:Message.Attach="[Event Click] = [Action PresetExport]" />
                                <Separator />
                                <MenuItem Header="Reset Built-in Presets" Micro:Message.Attach="[Event Click] = [Action PresetReset]" />
                            </MenuItem>
                        </Menu>
                    </ToolBar>
                </Grid>
            </GroupBox>
        </Grid>

        <!--  StatusPanel  -->
        <Controls:StatusPanel x:Name="loadingPanel"
                              Grid.Row="1"
                              Grid.RowSpan="2"
                              Height="70"
                              VerticalAlignment="Bottom"
                              Panel.ZIndex="10"
                              IsLoading="{Binding ShowStatusWindow}"
                              Message="{Binding StatusLabel}"
                              SubMessage="Please Wait ..."
                              />

        <!--  Status Bar  -->
        <StatusBar Grid.Row="2"
                   Grid.ColumnSpan="2"
                   Height="32"
                   Margin="0"
                   VerticalAlignment="Bottom"
                   Padding="0"
                   >
            <Label VerticalAlignment="Center"
                   Content="{Binding Path=ProgramStatusLabel}"
                   FontSize="11"
                   Padding="0,0,0,5"
                   />

        </StatusBar>
    </Grid>
</UserControl>
