<Application x:Class="Tango.Scripting.IDE.UI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Tango.Scripting.IDE.UI"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<!-- Accent and AppTheme setting -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatButton.xaml" />
<ResourceDictionary Source="pack://application:,,<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Tango.Scripting.IDE.Themes">
<Style x:Key="TangoMenuStyle" TargetType="{x:Type Menu}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Background" Value="{DynamicResource Menu.Background}"/>
<Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.MenuFontFamilyKey}}"/>
<Setter Property="FontSize" Value="{DynamicResource {x:Static SystemFonts.MenuFontSizeKey}}"/>
<Setter Property="FontStyle" Value="{DynamicResource {x:Static SystemFonts.MenuFontStyleKey}}"/>
<Setter Property="FontWeight" Value="{DynamicResource {x:Static SystemFonts.MenuFontWeightKey}}"/>
<Setter Property="Foreground" Value="{DynamicResource Menu.Foreground}"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Menu}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Resources>
<Style TargetType="{x:Type MenuItem}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Style.Triggers>
<Trigger Property="Role" Value="TopLevelHeader">
<Setter Property="Template" Value="{DynamicResource {x:Static MenuItem.TopLevelHeaderTemplateKey}}" />
<Setter Property="Grid.IsSharedSizeScope" Value="true" />
</Trigger>
<Trigger Property="Role" Value="TopLevelItem">
<Setter Property="Template" Value="{DynamicResource {x:Static MenuItem.TopLevelItemTemplateKey}}" />
</Trigger>
<Trigger Property="Role" Value="SubmenuHeader">
<Setter Property="Template" Value="{DynamicResource {x:Static MenuItem.SubmenuHeaderTemplateKey}}" />
</Trigger>
<Trigger Property="Role" Value="SubmenuItem">
<Setter Property="Template" Value="{DynamicResource {x:Static MenuItem.SubmenuItemTemplateKey}}" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"></Setter>
</Style>
</Style.Resources>
</Style>
<Geometry x:Key="Checkmark">M 0,5.1 L 1.7,5.2 L 3.4,7.1 L 8,0.4 L 9.2,0 L 3.3,10.8 Z</Geometry>
<!-- TopLevelHeader -->
<ControlTemplate x:Key="{x:Static MenuItem.TopLevelHeaderTemplateKey}" TargetType="{x:Type MenuItem}">
<Grid x:Name="Border" Background="Transparent" Margin="0,2,0,2">
<Rectangle x:Name="Bg" Fill="Transparent" />
<Rectangle x:Name="Inner_Border" Margin="4" Fill="Transparent"/>
<ContentPresenter Margin="8,2,8,2" ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
<Popup x:Name="Popup" Placement="Bottom" IsOpen="{TemplateBinding IsSubmenuOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade" HorizontalOffset="2">
<Border x:Name="SubmenuBorder" BorderBrush="{DynamicResource MenuItemHighlightedBackground}" BorderThickness="1" Background="{DynamicResource Menu.Background}" Padding="2" Margin="0,0,8,8">
<Border.Effect>
<DropShadowEffect BlurRadius="6" Opacity="0.5" ShadowDepth="4" Direction="330"/>
</Border.Effect>
<Grid RenderOptions.ClearTypeHint="Enabled" Background="Transparent">
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" Grid.IsSharedSizeScope="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle"/>
</Grid>
</Border>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSuspendingPopupAnimation" Value="true">
<Setter TargetName="Popup" Property="PopupAnimation" Value="None" />
</Trigger>
<Trigger Property="IsHighlighted" Value="true">
<Setter Property="Fill" TargetName="Bg" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/>
</Trigger>
<Trigger SourceName="Popup" Property="AllowsTransparency" Value="True">
<Setter TargetName="SubmenuBorder" Property="CornerRadius" Value="0,0,0,0" />
<Setter TargetName="SubmenuBorder" Property="Padding" Value="0,0,0,3" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource Menu.Disable.Foreground}"/>
</Trigger>
<Trigger Property="IsSubmenuOpen" Value="true">
<Setter Property="Background" TargetName="Border" Value="{DynamicResource Menu.Submenu.Background}"/>
<Setter Property="Fill" TargetName="Bg" Value="{DynamicResource Menu.Submenu.Background}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!-- TopLevelItem -->
<ControlTemplate x:Key="{x:Static MenuItem.TopLevelItemTemplateKey}" TargetType="{x:Type MenuItem}" >
<Grid SnapsToDevicePixels="true" Background="Transparent" Margin="0,2,0,2">
<Rectangle x:Name="Bg" Fill="Transparent" />
<Rectangle x:Name="InnerBorder" Margin="4" Fill="Transparent"/>
<!--<DockPanel>
<ContentPresenter x:Name="Icon" ContentSource="Icon" Margin="4,0,6,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
<Path x:Name="GlyphPanel" Data="{StaticResource Checkmark}" Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" Margin="7,0,0,0" Visibility="Collapsed" VerticalAlignment="Center"/>-->
<ContentPresenter ContentSource="Header" Margin="8,2,8,2" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
<!--</DockPanel>-->
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsHighlighted" Value="true">
<Setter Property="Fill" TargetName="Bg" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource Menu.Disable.Foreground}"/>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter Property="Fill" TargetName="Bg" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="{x:Static MenuItem.SubmenuHeaderTemplateKey}" TargetType="MenuItem">
<Grid SnapsToDevicePixels="true" Background="{DynamicResource Menu.Submenu.Background}" x:Name="_grid" MinHeight="22">
<Rectangle x:Name="Bg" Fill="Transparent" />
<Rectangle x:Name="Inner_Border" Margin="4" Fill="Transparent"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition SharedSizeGroup="Icon" Width="Auto" MinWidth="20"/>
<ColumnDefinition Width="*" MinWidth="60"/>
<ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto" MinWidth="60"/>
<ColumnDefinition Width="13" />
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="Iconh" ContentSource="Icon" Margin="3" VerticalAlignment="Center" Grid.Column="0"/>
<ContentPresenter x:Name="HeaderHost" Margin="3,0,3,0" Grid.Column="1" VerticalAlignment="Center" ContentSource="Header" RecognizesAccessKey="True" TextOptions.TextFormattingMode="Display" />
<TextBlock Grid.Column="2" Margin="10,0,0,0" Text="{TemplateBinding InputGestureText}" VerticalAlignment="Center"/>
<Path x:Name="RightArrow" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 0 7 L 4 3.5 Z" Fill="{DynamicResource Grip.Submenu.Background.Static}" Margin="8,0,0,0"/>
<Popup x:Name="popup" PlacementTarget="{Binding ElementName=_grid}" Placement="Right" HorizontalOffset="0" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade">
<Border x:Name="SubmenuBorder" SnapsToDevicePixels="True" Background="{DynamicResource Menu.Submenu.Background}" BorderThickness="1" BorderBrush="{DynamicResource MenuItemHighlightedBackground}" Margin="0,0,10,10">
<Border.Effect>
<DropShadowEffect BlurRadius="6" Opacity="0.5" ShadowDepth="4" Direction="330" />
</Border.Effect>
<ItemsPresenter x:Name="_items" />
</Border>
</Popup>
</Grid>
</Grid>
<!--</Border>-->
<ControlTemplate.Triggers>
<Trigger Property="IsHighlighted" Value="True" >
<Setter Property="Visibility" Value="Visible" TargetName="_items" />
<Setter Property="IsOpen" Value="True" TargetName="popup" />
<Setter Property="Fill" TargetName="Bg" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/>
<Setter Property="Fill" TargetName="Inner_Border" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/>
<Setter TargetName="RightArrow" Property="Fill" Value="{DynamicResource Grip.Submenu.Background.Selected}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource Menu.Disable.Foreground}"/>
</Trigger>
<Trigger Property="IsSubmenuOpen" Value="true">
<Setter Property="Fill" TargetName="Bg" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/>
<Setter Property="Fill" TargetName="Inner_Border" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="{x:Static MenuItem.SubmenuItemTemplateKey}" TargetType="MenuItem">
<Grid SnapsToDevicePixels="true" Background="{DynamicResource Menu.Submenu.Background}" MinHeight="22">
<Rectangle x:Name="Bg" Fill="Transparent" />
<Rectangle x:Name="InnerBorder" Margin="4"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="24" SharedSizeGroup="IconGroup"/>
<ColumnDefinition Width="Auto" MinWidth="60" />
<ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto" MinWidth="60"/>
<ColumnDefinition Width="20" />
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="Icon" ContentSource="Icon" Margin="{TemplateBinding Padding}" />
<ContentPresenter Grid.Column="1" VerticalAlignment="Center" ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
<TextBlock Grid.Column="2" Margin="10,0,0,0" Text="{TemplateBinding InputGestureText}" VerticalAlignment="Center"/>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsHighlighted" Value="True">
<Setter Property="Fill" TargetName="Bg" Value="{DynamicResource Menu.Submenu.MouseOverColor}"/>
</Trigger>
<Trigger Property="Icon" Value="{x:Null}">
<Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="{x:Type Separator}">
<Setter Property="Height" Value="1" />
<Setter Property="Margin" Value="20,0,2,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<Border BorderThickness="1" BorderBrush="{DynamicResource Submenu.MouseOverColor}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type ContextMenu}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Grid.IsSharedSizeScope" Value="true" />
<Setter Property="HasDropShadow" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContextMenu}">
<Border x:Name="Border" Background="{DynamicResource Background.Static}" BorderThickness="1" BorderBrush="{DynamicResource Inactive.Selection}">
<Border.Effect>
<DropShadowEffect Color="Black" Direction="135" Opacity="0.8" ShadowDepth="2"/>
</Border.Effect>
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource Menu.Submenu.Background}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource ContextMenu.MouseOverColor}" />
</Trigger>
<Trigger Property="HasDropShadow" Value="true">
<Setter TargetName="Border" Property="Padding" Value="0,3,0,3" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Resources>
<Style TargetType="{x:Type MenuItem}">
<Setter Property="Background" Value="{DynamicResource Menu.Submenu.Background}"></Setter>
<Setter Property="Foreground" Value="{DynamicResource ControlTextBrush}"></Setter>
<Setter Property="Margin" Value="1,0,1,0"></Setter>
</Style>
</Style.Resources>
</Style>
</ResourceDictionary>