<Grid x:Class="HandyControlDemo.UserControl.NonClientAreaContent"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
      xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
      Height="29"
      DataContext="{Binding NoUser,Source={StaticResource Locator}}"
      xmlns:hc="https://handyorg.github.io/handycontrol"
      xmlns:data="clr-namespace:HandyControlDemo.Data">
    <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <StackPanel VerticalAlignment="Stretch" Orientation="Horizontal">
        <Menu Margin="10,0,0,0" Background="Transparent">
            <MenuItem Height="29" Header="{ex:Lang Key={x:Static langs:LangKeys.Repository}}">
                <MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://github.com/NaBian/HandyControl" Header="GitHub">
                    <MenuItem.Icon>
                        <Path Data="{StaticResource GithubGeometry}" Fill="{DynamicResource PrimaryTextBrush}" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://www.nuget.org/packages/HandyControl" Header="NuGet">
                    <MenuItem.Icon>
                        <Path Data="{StaticResource NugetGeometry}" Fill="#30a5dd" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://marketplace.visualstudio.com/items?itemName=HandyOrg.handycontrolforvs2019" Header="{ex:Lang Key={x:Static langs:LangKeys.Vsix}}">
                    <MenuItem.Icon>
                        <Path Data="{StaticResource VisualStudioGeometry}" Fill="{DynamicResource PrimaryTextBrush}" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>
            </MenuItem>
            <MenuItem Height="29" Header="{ex:Lang Key={x:Static langs:LangKeys.About}}">
                <MenuItem Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.ContributorsView}" Header="{ex:Lang Key={x:Static langs:LangKeys.Contributors}}">
                    <MenuItem.Icon>
                        <Path Data="{StaticResource ContributorsGeometry}" Fill="#ef6c00" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.QQGroupView}" Header="{ex:Lang Key={x:Static langs:LangKeys.QQGroup}}">
                    <MenuItem.Icon>
                        <Path Data="{StaticResource QqGeometry}" Fill="{DynamicResource PrimaryBrush}" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="mailto:836904362@qq.com" Header="{ex:Lang Key={x:Static langs:LangKeys.Email}}">
                    <MenuItem.Icon>
                        <Path Data="{StaticResource EmailGeometry}" Fill="{DynamicResource WarningBrush}" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://gitter.im/HandyControl/Lobby" Header="{ex:Lang Key={x:Static langs:LangKeys.Chatroom}}">
                    <MenuItem.Icon>
                        <Path Data="{StaticResource GitterGeometry}" Fill="#e52e64" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://www.cnblogs.com/nabian" Header="{ex:Lang Key={x:Static langs:LangKeys.Blog}}">
                    <MenuItem.Icon>
                        <Path Data="{StaticResource CnblogsGeometry}" Fill="{DynamicResource PrimaryTextBrush}" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="{ex:Lang Key={x:Static langs:LangKeys.Demo}}">
                    <MenuItem.Icon>
                        <Path Data="{StaticResource CodeGeometry}" Fill="{DynamicResource PrimaryTextBrush}" Stretch="Uniform"/>
                    </MenuItem.Icon>
                    <MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://github.com/AFei19911012/HandyControl" Header="AFei19911012 / HandyControl">
                        <MenuItem.Icon>
                            <Path Data="{StaticResource CodeGeometry}" Fill="{DynamicResource PrimaryTextBrush}" Stretch="Uniform"/>
                        </MenuItem.Icon>
                    </MenuItem>
                </MenuItem>
                <MenuItem Header="{ex:Lang Key={x:Static langs:LangKeys.Documentation}}">
                    <MenuItem.Icon>
                        <Path Data="{StaticResource DocGeometry}" Fill="{DynamicResource PrimaryBrush}" Stretch="Uniform"/>
                    </MenuItem.Icon>
                    <MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://github.com/ghost1372/HandyControl/wiki/Documentation" Header="Wiki">
                        <MenuItem.Icon>
                            <Path Data="{StaticResource WikiGeometry}" Fill="{DynamicResource PrimaryTextBrush}" Stretch="Uniform"/>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://ghost1372.github.io" Header="{ex:Lang Key={x:Static langs:LangKeys.Doc_en}}">
                        <MenuItem.Icon>
                            <Path Data="{StaticResource LogoGeometry}" Fill="#ef6c00" Stretch="Uniform"/>
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://handyorg.github.io" Header="{ex:Lang Key={x:Static langs:LangKeys.Doc_cn}}">
                        <MenuItem.Icon>
                            <Path Data="{StaticResource LogoGeometry}" Fill="#ef6c00" Stretch="Uniform"/>
                        </MenuItem.Icon>
                    </MenuItem>
                </MenuItem>
                <MenuItem Header="{ex:Lang Key={x:Static langs:LangKeys.About}}" Click="MenuAbout_OnClick">
                    <MenuItem.Icon>
                        <Path Data="{StaticResource InfoGeometry}" Fill="{DynamicResource SuccessBrush}" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>
            </MenuItem>
            <MenuItem Height="29" Header="{ex:Lang Key={x:Static langs:LangKeys.Recommendation}}">
                <MenuItem Header="{ex:Lang Key={x:Static langs:LangKeys.Project}}" Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.ProjectsView}" >
                    <MenuItem.Icon>
                        <Path Data="{StaticResource ProjectGeometry}" Fill="{DynamicResource PrimaryTextBrush}" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="{ex:Lang Key={x:Static langs:LangKeys.Blog}}" Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.BlogsView}" >
                    <MenuItem.Icon>
                        <Path Data="{StaticResource BlogGeometry}" Fill="{DynamicResource PrimaryBrush}" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem Header="{ex:Lang Key={x:Static langs:LangKeys.Website}}" Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.WebsitesView}" >
                    <MenuItem.Icon>
                        <Path Data="{StaticResource WebsiteGeometry}" Fill="{DynamicResource WarningBrush}" Stretch="Uniform"/>
                    </MenuItem.Icon>
                </MenuItem>
            </MenuItem>
        </Menu>
        <Border Margin="10,0,0,0" VerticalAlignment="Center" CornerRadius="2" Padding="10,4" Background="{DynamicResource SecondaryRegionBrush}">
            <TextBlock FontWeight="Bold" Text="{Binding VersionInfo}" VerticalAlignment="Center" Foreground="{DynamicResource PrimaryTextBrush}"/>
        </Border>
    </StackPanel>
    <Button Grid.Column="1" Click="ButtonConfig_OnClick" Name="ButtonConfig" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource PrimaryTextBrush}" hc:IconElement.Geometry="{StaticResource ConfigGeometry}"/>
    <Popup AllowsTransparency="True" Grid.Column="1" PlacementTarget="{Binding ElementName=ButtonConfig}" HorizontalOffset="-28" Name="PopupConfig" VerticalOffset="6" StaysOpen="False">
        <Border Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="4" Margin="16" Effect="{StaticResource EffectShadow2}">
            <StackPanel Orientation="Horizontal">
                <StackPanel Orientation="Horizontal" Margin="10">
                    <StackPanel Button.Click="ButtonLangs_OnClick">
                        <Button Tag="zh-cn" Style="{StaticResource ButtonCustom}">
                            <Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/cn.png"/>
                        </Button>
                        <Button Tag="en" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
                            <Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/en.png"/>
                        </Button>
                        <Button Tag="fa" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
                            <Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/fa.png"/>
                        </Button>
                        <Button Tag="fr" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
                            <Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/fr.png"/>
                        </Button>
                        <Button Tag="ca-ES" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
                            <Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/ca-Es.png"/>
                        </Button>
                    </StackPanel>
                    <StackPanel Button.Click="ButtonLangs_OnClick" Margin="10,0,0,0">
                        <Button Tag="ko-KR" Style="{StaticResource ButtonCustom}">
                            <Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/ko-KR.png"/>
                        </Button>
                        <Button Tag="ru" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
                            <Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/ru.png"/>
                        </Button>
                        <Button Tag="tr" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
                            <Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/tr.png"/>
                        </Button>
                        <Button Tag="pt-BR" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
                            <Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/pt-BR.png"/>
                        </Button>
                        <Button Tag="pl" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
                            <Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/pl.png" />
                        </Button>
                    </StackPanel>
                </StackPanel>
                <hc:Divider LineStrokeDashArray="2,2" Orientation="Vertical" Margin="0,20" LineStrokeThickness="2"/>
                <StackPanel Button.Click="ButtonSkins_OnClick"  Margin="10,10,10,10">
                    <Button Tag="{x:Static hc:SkinType.Default}" Style="{StaticResource ButtonCustom}">
                        <Border Background="White" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
                    </Button>
                    <Button Tag="{x:Static hc:SkinType.Dark}" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
                        <Border Background="Black" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
                    </Button>
                    <Button Tag="{x:Static hc:SkinType.Violet}" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
                        <Border Background="DarkViolet" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
                    </Button>
                </StackPanel>
            </StackPanel>
        </Border>
    </Popup>
</Grid>
