<Window x:Class="WowUp.WPF.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:WowUp.WPF"
        xmlns:vw = "clr-namespace:WowUp.WPF.Views" 
        mc:Ignorable="d"
        Title="WowUp.io" 
        Padding="0"
        AllowsTransparency="True"
        Background="#383773"
        Height="450" 
        Width="1024"
        WindowStyle="None"
        BorderThickness="0"
        Margin="0"
        MinWidth="800"
        MinHeight="400"
        SizeChanged="Window_SizeChanged"
        BorderBrush="Transparent"
        ResizeMode="CanResize"
        StateChanged="Window_StateChanged"
        IsVisibleChanged="Window_IsVisibleChanged"
        Loaded="Window_Loaded">

    <WindowChrome.WindowChrome>
        <WindowChrome CaptionHeight="32"
                      CornerRadius="0"
                      GlassFrameThickness="0"
                      ResizeBorderThickness="4" />
    </WindowChrome.WindowChrome>

    <Window.Resources>
        <ResourceDictionary >
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Views/Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Border Style="{StaticResource WindowMainPanelStyle}">
        <Grid Background="{StaticResource Dark3}" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <!--TOOLBAR-->
            <Grid Grid.Row="0"  Background="{StaticResource Purple1}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Border Grid.Column="0" Padding="10, 0" >
                    <StackPanel Orientation="Horizontal">
                        <Image Source="Assets/wowup_logo_512np.png" Margin="0, 0, 10, 0" Height="40" 
                               RenderOptions.BitmapScalingMode="HighQuality"/>
                        <TextBlock Text="{Binding Title}" Foreground="White" VerticalAlignment="Center" FontSize="15"/>
                    </StackPanel>
                </Border>
                <StackPanel Grid.Column="1" Orientation="Horizontal">
                    <Button
                            x:Name="MinimizeButton"
                            Click="MinimizeButton_Click"
                            RenderOptions.EdgeMode="Aliased"
                            Style="{StaticResource TitleBarButtonStyle}">
                        <Path Width="46"
                              Height="32"
                              Data="M 18,15 H 28"
                              Stroke="{Binding Path=Foreground, 
                                RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
                              StrokeThickness="1" />
                    </Button>
                    <Button x:Name="MaximizeButton"
                        Click="MaximizeRestoreButton_Click"
                        Visibility="{Binding MaximizeVisibility}"
                        Style="{StaticResource TitleBarButtonStyle}">
                        <Path Width="46"
                          Height="32"
                          Data="M 18.5,10.5 H 27.5 V 19.5 H 18.5 Z"
                          Stroke="{Binding Path=Foreground,
							 RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
                          StrokeThickness="1" />
                    </Button>
                    <Button x:Name="RestoreButton"
                        Click="MaximizeRestoreButton_Click"
                        Visibility="{Binding RestoreVisibility}"
                        Style="{StaticResource TitleBarButtonStyle}">
                        <Path Width="46"
                          Height="32"
                          Data="M 18.5,12.5 H 25.5 V 19.5 H 18.5 Z M 20.5,12.5 V 10.5 H 27.5 V 17.5 H 25.5"
                          Stroke="{Binding Path=Foreground,
							 RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
                          StrokeThickness="1" />
                    </Button>
                    <Button x:Name="CloseButton" 
                            Command="{Binding CloseWindowCommand}"
                            Style="{StaticResource TitleBarCloseButtonStyle}">
                        <Path Width="46"
                              Height="32"
                              Data="M 18,11 27,20 M 18,20 27,11"
                              Stroke="{Binding Path=Foreground,
							     RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
                              StrokeThickness="1" />
                    </Button>
                </StackPanel>
            </Grid>
            <!--UPDATE VIEW-->
            <vw:ApplicationUpdateControl Grid.Row="1" DataContext="{Binding ApplicationUpdateControlViewModel}"  />
            <!--SELECT FOLDER BLURB-->
            <StackPanel Visibility="{Binding ShowWowSelection, Converter={StaticResource BoolToVisibilty}}" 
                        Grid.Row="2"
                        VerticalAlignment="Center"
                        HorizontalAlignment="Center">
                <TextBlock Text="Welcome" FontSize="20" HorizontalAlignment="Center" />
                <TextBlock Text="We were unable to detect an installed World of Warcraft clients." 
                           FontSize="14"
                           HorizontalAlignment="Center"/>
                <TextBlock Text="Please ensure your Battle.net app is up to date!" 
                           Foreground="{StaticResource White2Brush}" 
                           FontSize="12"
                           HorizontalAlignment="Center"/>
            </StackPanel>
            <!--TABS-->
            <TabControl x:Name="Tabs" 
                        Grid.Row="2" 
                        Visibility="{Binding ShowTabs, Converter={StaticResource BoolToVisibilty}}"
                        Style="{StaticResource CustomTabStyle}"
                        ItemsSource="{Binding TabItems}">
            </TabControl>
            <!--FOOTER-->
            <Border Grid.Row="3" Padding="10 5" Background="{StaticResource Dark4}">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <TextBlock Grid.Column="0" Margin="0 0" HorizontalAlignment="Left" VerticalAlignment="Center">
                        <Hyperlink x:Name="PatreonLink" NavigateUri="https://www.patreon.com/jliddev" TextDecorations="None" RequestNavigate="PatreonLink_RequestNavigate">
                            <Image Source="/Assets/patron.png" Height="25"  />
                        </Hyperlink>
                    </TextBlock>
                    <TextBlock Grid.Column="1" Text="{Binding Version}" VerticalAlignment="Center" Foreground="{StaticResource White3Brush}"></TextBlock>
                </Grid>
            </Border>
        </Grid>
    </Border>
</Window>
