<Window x:Class="___C_File_Editor.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:my="clr-namespace:___C_File_Editor"
        xmlns:custom="clr-namespace:CustomControls"
        Title="___C_File_Editor" SnapsToDevicePixels="True"
        Background="#FF333333" MinWidth="668" Drop="MainWindow_DragDrop" AllowDrop="True" DragOver="MainWindow_DragOver" Width="668" Height="222" MinHeight="160" MaxHeight="230" AllowsTransparency="True" WindowStyle="None" Closing="Window_Closing" x:Name="mainWindow" Activated="mainWindow_Activated" ResizeMode="NoResize">
  <Window.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Themes/MetroDark/MetroDark.MSControls.Core.Implicit.xaml" />
        <ResourceDictionary Source="Common/CommonStyles.xaml"/>
        <ResourceDictionary Source="Common/CustomControls.xaml"/>
      </ResourceDictionary.MergedDictionaries>
      <Storyboard x:Key="fadeIn" Completed="FadeInAnimation_Completed">
        <ParallelTimeline>
          <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="mainWindow" From="0" To="1" Duration="0:0:0.12"/>
        </ParallelTimeline>
      </Storyboard>
      <Storyboard x:Key="fadeOut" Completed="FadeOutAnimation_Completed">
        <ParallelTimeline>
          <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="mainWindow" From="1" To="0" Duration="0:0:0.12"/>
        </ParallelTimeline>
      </Storyboard>
      <RoutedCommand x:Key="pathPaste"/>
    </ResourceDictionary>
  </Window.Resources>
  <WindowChrome.WindowChrome>
    <WindowChrome CaptionHeight="{x:Static SystemParameters.CaptionHeight}" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" UseAeroCaptionButtons="False"/>
  </WindowChrome.WindowChrome>
  <Window.CommandBindings>
    <CommandBinding Command="ApplicationCommands.Open" CanExecute="openCommand_CanExecute" Executed="openCommand_Executed" />
    <CommandBinding Command="ApplicationCommands.Save" CanExecute="saveCommand_CanExecute" Executed="saveCommand_Executed" />
    <CommandBinding Command="ApplicationCommands.SaveAs" CanExecute="saveAsCommand_CanExecute" Executed="saveAsCommand_Executed" />
    <CommandBinding Command="ApplicationCommands.Close" CanExecute="exitCommand_CanExecute" Executed="exitCommand_Executed" />
    <CommandBinding Command="{StaticResource pathPaste}" CanExecute="pathPasteCommand_CanExecute" Executed="pathPasteCommand_Executed"/>
  </Window.CommandBindings>
  <Window.InputBindings>
    <KeyBinding Gesture="Ctrl+Q" Command="ApplicationCommands.Close" />
    <KeyBinding Gesture="Ctrl+O" Command="ApplicationCommands.Open" />
    <KeyBinding Gesture="Ctrl+S" Command="ApplicationCommands.Save" />
    <KeyBinding Gesture="Ctrl+Shift+S" Command="ApplicationCommands.SaveAs" />
    <KeyBinding Gesture="Ctrl+V" Command="{StaticResource pathPaste}"/>
  </Window.InputBindings>
  <Border BorderThickness="1" BorderBrush="#FF666666">
    <Grid>
      <StackPanel Orientation="Horizontal" Margin="0,5,5,0" HorizontalAlignment="Right" VerticalAlignment="Top">
        <StackPanel.Resources>
          <my:EqualsToVisibleConveter x:Key="visiConverter" />
        </StackPanel.Resources>
        <Button Content="0" Style="{DynamicResource CaptionButtonStyleKey}" Click="ButtonMinimized_Click" />
        <Button Content="1" Style="{DynamicResource CaptionButtonStyleKey}" Click="ButtonMaximized_Click">
          <Button.Visibility>
            <Binding RelativeSource="{RelativeSource AncestorType=Window}" Path="WindowState" Mode="OneWay" Converter="{StaticResource visiConverter}">
              <Binding.ConverterParameter>
                <WindowState>Normal</WindowState>
              </Binding.ConverterParameter>
            </Binding>
          </Button.Visibility>
        </Button>
        <Button Content="2" Style="{DynamicResource CaptionButtonStyleKey}" Click="ButtonNormal_Click">
          <Button.Visibility>
            <Binding RelativeSource="{RelativeSource AncestorType=Window}" Path="WindowState" Mode="OneWay" Converter="{StaticResource visiConverter}">
              <Binding.ConverterParameter>
                <WindowState>Maximized</WindowState>
              </Binding.ConverterParameter>
            </Binding>
          </Button.Visibility>
        </Button>
        <Button Content="r" Style="{DynamicResource CaptionButtonStyleKey}" Command="ApplicationCommands.Close"/>
      </StackPanel>
      <Label x:Name="labelTitle" HorizontalAlignment="Left" Margin="3,2,0,0" VerticalAlignment="Top"/>
      <Grid Margin="5,33,5,30">
        <Grid.RowDefinitions>
          <RowDefinition Height="38"/>
          <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Button x:Name="btnOpen" Content="開く" HorizontalAlignment="Left" VerticalAlignment="Top" Width="90" Command="ApplicationCommands.Open"/>
        <Button x:Name="btnSave" Content="上書き保存" HorizontalAlignment="Left" VerticalAlignment="Top" Width="90" Command="ApplicationCommands.Save" Margin="96,0,0,0" IsEnabled="False"/>
        <Button x:Name="btnSaveAs" Content="別名で保存" HorizontalAlignment="Left" VerticalAlignment="Top" Width="90" Command="ApplicationCommands.SaveAs" Margin="191,0,0,0" IsEnabled="False"/>
        <CheckBox x:Name="cbAlpha152" Content="Alpha152" HorizontalAlignment="Right" Margin="0,6,10,0" VerticalAlignment="Top" Checked="cbAlpha152_Checked" Unchecked="cbAlpha152_Unchecked" Visibility="Collapsed"/>
        <StackPanel Margin="0" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top">
          <GroupBox x:Name="gbVisibleFlag" Header="表示フラグ" Margin="0,0,0,0" IsEnabled="False" Width="655" HorizontalAlignment="Left" VerticalAlignment="Top" Height="56">
            <StackPanel x:Name="panelHairstyles" Orientation="Horizontal"/>
          </GroupBox>
          <GroupBox x:Name="gbOtherFlag" Header="その他の設定" Margin="0,5,0,0" IsEnabled="False" Width="655" HorizontalAlignment="Left" VerticalAlignment="Top" Height="56">
            <CheckBox x:Name="cbHideGlasses" Content="デフォルト眼鏡を非表示" HorizontalAlignment="Left" VerticalAlignment="Top"/>
          </GroupBox>
          <GroupBox x:Name="gbAlpha152" Header="Alpha152 Parameter" Margin="0,5,0,0" IsEnabled="False" HorizontalContentAlignment="Stretch" Padding="3,5,1,5" HorizontalAlignment="Left" VerticalAlignment="Top" Width="655" Visibility="Collapsed">
            <StackPanel x:Name="panelAlpha152" Orientation="Horizontal"/>
          </GroupBox>
        </StackPanel>
      </Grid>
      <custom:PathTrimTextBlock x:Name="textStatus" Margin="5" Path="ファイルを開いて下さい" VerticalAlignment="Bottom"/>
    </Grid>
  </Border>
</Window>