<ui:DialogWindow x:Class="GitHub.VisualStudio.Views.Dialog.GitHubDialogWindow"
                   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:ui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
                   xmlns:shellControls="clr-namespace:Microsoft.VisualStudio.PlatformUI.Shell.Controls;assembly=Microsoft.VisualStudio.Shell.ViewManager"
                   xmlns:local="clr-namespace:GitHub.VisualStudio.Views"
                   xmlns:ghfvs="https://github.com/github/VisualStudio"
                   mc:Ignorable="d"
                   Title="{Binding Content.Title, FallbackValue=GitHub}"
                   Width="414"
                   Height="460"
                   MinWidth="414"
                   MinHeight="460"
                   xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.14.0"
                   Background="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelBrushKey}}"
                   Foreground="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelTextBrushKey}}"
                   FontFamily="Segoe UI"
                   FontSize="12"
                   FontStretch="Normal"
                   FontStyle="Normal"
                   FontWeight="Normal"
                   SnapsToDevicePixels="True"
                   UseLayoutRounding="True"
                   WindowStartupLocation="CenterOwner"
                   WindowStyle="None"
                   WindowState="Normal" 
                   ResizeMode="CanResize"
                   ShowInTaskbar="false"
                   Content="{Binding Content}">
    <WindowChrome.WindowChrome>
        <WindowChrome 
            CaptionHeight="0"
            ResizeBorderThickness="5" />
    </WindowChrome.WindowChrome>
    <Window.Resources>
        <ResourceDictionary>
            <local:ViewLocator x:Key="viewLocator"/>
            <DataTemplate DataType="{x:Type ghfvs:ViewModelBase}">
                <ContentControl Content="{Binding Converter={StaticResource viewLocator}}"/>
            </DataTemplate>
        </ResourceDictionary>
    </Window.Resources>
    <Window.ContentTemplate>
        <DataTemplate>
            <Border MouseDown="Border_MouseDown"
                    BorderThickness="1"
                    Background="{DynamicResource {x:Static vs:ThemedDialogColors.WindowPanelBrushKey}}"
                    BorderBrush="{DynamicResource {x:Static vs:ThemedDialogColors.WindowBorderBrushKey}}">
                <DockPanel>
                    <DockPanel DockPanel.Dock="Top">
                        <Label Content="{Binding Title}"
                               Foreground="{DynamicResource {x:Static ui:ThemedDialogColors.WindowPanelTextBrushKey}}"
                               DockPanel.Dock="Left"
                               Margin="9,5,0,0"
                               />

                        <!-- close button and padding -->
                        <shellControls:GlyphButton x:Uid="button_Close"
                               x:Name="CloseButton"
                               Width="46"
                               Height="33"
                               DockPanel.Dock="Right"
                               HorizontalAlignment="Right"
                               VerticalAlignment="Top"
                               BorderBrush="Transparent"
                               BorderThickness="0"
                               Background="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonBrushKey}}"
                               GlyphForeground="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonGlyphBrushKey}}"
                               HoverBackground="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonHoverBrushKey}}"
                               HoverForeground="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonHoverGlyphBrushKey}}"
                               HoverBorderBrush="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonHoverBorderBrushKey}}"
                               PressedBackground="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonDownBrushKey}}"
                               PressedForeground="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonDownGlyphBrushKey}}"
                               PressedBorderBrush="{DynamicResource {x:Static ui:ThemedDialogColors.WindowButtonDownBorderBrushKey}}"
                               Click="CloseButton_Click">
                            <Path x:Uid="path_CloseButton"
                                Width="16"
                                Height="16"
                                Fill="{Binding Path=(TextElement.Foreground), RelativeSource={RelativeSource Self}}"
                                Data="F1M8.583,8L13,12.424 12.424,13 8,8.583 3.576,13 3,12.424 7.417,8 3,3.576 3.576,3 8,7.417 12.424,3 13,3.576z"/>
                        </shellControls:GlyphButton>

                    </DockPanel>

                    <!-- content -->
                    <ContentControl Content="{Binding Converter={StaticResource viewLocator}}"/>
                </DockPanel>
            </Border>
        </DataTemplate>
    </Window.ContentTemplate>
</ui:DialogWindow>
