<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:bpa="clr-namespace:BPA.UIControl">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/BPA.UIControl;component/Themes/Menu.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="RubyerContextMenu" TargetType="{x:Type ContextMenu}">
        <Setter Property="Background" Value="{DynamicResource FloatBackground}" />
        <Setter Property="BorderBrush" Value="{DynamicResource Border}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Margin" Value="5" />
        <Setter Property="Padding" Value="0 5" />
        <Setter Property="Grid.IsSharedSizeScope" Value="True" />
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="bpa:ControlHelper.CornerRadius" Value="{DynamicResource AllControlCornerRadius}" />
        <Setter Property="bpa:ControlHelper.MaskOpacity" Value="0.6" />
        <Setter Property="bpa:ControlHelper.FocusedBrush" Value="{DynamicResource Mask}" />
        <Setter Property="bpa:ItemsControlHelper.ItemMargin" Value="5 1" />
        <Setter Property="bpa:ItemsControlHelper.ItemPadding" Value="10 5" />
        <Setter Property="bpa:MenuHelper.IconWidth" Value="24" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContextMenu}">
                    <Grid>
                        <Border Margin="{TemplateBinding Margin}"
                                Padding="{TemplateBinding Padding}"
                                Background="{DynamicResource FloatBackground}"
                                CornerRadius="{Binding Path=(bpa:ControlHelper.CornerRadius), RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                Effect="{DynamicResource AllDirectionEffect2}" />

                        <Border x:Name="Border"
                                Margin="{TemplateBinding Margin}"
                                Padding="{TemplateBinding Padding}"
                                Background="{DynamicResource FloatBackground}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="{Binding Path=(bpa:ControlHelper.CornerRadius), RelativeSource={RelativeSource Mode=TemplatedParent}}">
                            <StackPanel IsItemsHost="True"
                                        KeyboardNavigation.DirectionalNavigation="Cycle"
                                        KeyboardNavigation.TabNavigation="Cycle"
                                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>