Pages

Wednesday 9 February 2011

applying styles for ag menus in silverlight

    <ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:dxm="clr-namespace:DevExpress.AgMenu;assembly=DevExpress.AgMenu.v8.2"
  xmlns:dxms="clr-namespace:DevExpress.AgMenu.DefaultStyle;assembly=DevExpress.AgMenu.v8.2"
  xmlns:dxmi="clr-namespace:DevExpress.AgMenu.Internal;assembly=DevExpress.AgMenu.v8.2">

    <dxm:AgMenuTemplateList x:Key="TemplateCollection;DarkRoom">

        <dxm:AgMenuTemplateListItem Key="Horizontal">
            <dxm:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="dxm:AgMenu">
                    <Grid>
                        <Border x:Name="ElementEmptyArea" CornerRadius="0,0,0,0">
                            <Border.Background>
                                <SolidColorBrush Color="#646874"></SolidColorBrush>
                            </Border.Background>
                        </Border>
                        <ItemsPresenter HorizontalAlignment="Left"/>
                    </Grid>
                </ControlTemplate>
            </dxm:AgMenuTemplateListItem.Template>
        </dxm:AgMenuTemplateListItem>

        <dxm:AgMenuTemplateListItem Key="Vertical">
            <dxm:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="dxm:AgMenu">
                    <Grid>
                        <Border x:Name="ElementEmptyArea" Background="#9f0d2d" CornerRadius="0,0,0,0"/>
                        <ItemsPresenter VerticalAlignment="Top"/>
                    </Grid>
                </ControlTemplate>
            </dxm:AgMenuTemplateListItem.Template>
        </dxm:AgMenuTemplateListItem>

    </dxm:AgMenuTemplateList>

    <!-- AgMenuItem;Horizontal;ContentPresenter;DarkRoom -->
    <ControlTemplate x:Key="AgMenuItem;Horizontal;ContentPresenter;DarkRoom" TargetType="dxmi:AgMenuItemContentPresenter">
        <Grid x:Name="ElementRoot" Margin="{TemplateBinding Padding}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid x:Name="ElementIconCheckAreaContainer" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center">
                <Grid x:Name="ElementIconCheckArea">
                    <Grid x:Name="ElementIconAreaContainer">
                        <Grid x:Name="ElementIconArea">
                            <ContentControl x:Name="ElementIcon" Content="{TemplateBinding Icon}" Margin="0,1,4,1"/>
                        </Grid>
                    </Grid>
                </Grid>
            </Grid>
            <ContentControl
          FontSize="11"
          FontFamily="Arial"
          Content="{TemplateBinding Header}"
          ContentTemplate="{TemplateBinding HeaderTemplate}"
          Grid.Column="1"
          Grid.Row="0"
          VerticalAlignment="Center"
          Foreground="{TemplateBinding Foreground}"/>
            <ContentControl
          x:Name="ElementContent"
          Content="{TemplateBinding Content}"
          ContentTemplate="{TemplateBinding ContentTemplate}"
          Foreground="{TemplateBinding Foreground}"
          Grid.Column="1"
          Grid.Row="0"/>
        </Grid>
    </ControlTemplate>

 
    <dxm:AgMenuTemplateList x:Key="ItemContainerTemplates;DarkRoom">

        <!-- Top Menu Item - Horizontal (File, Edit etc...) -->
        <dxm:AgMenuTemplateListItem Key="AgMenuItem;Horizontal">
            <dxm:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="dxm:AgMenuItem">
                    <Grid x:Name="ElementRoot" Background="#646874">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#646874"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#646874"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="White"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Hot">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DroppedDown">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#646874"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#646874"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DroppedDownSelected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="Opacity" To=".4"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackground" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border HorizontalAlignment="Stretch" Width="Auto" Grid.ColumnSpan="1"
       BorderThickness="0,0,2,0" BorderBrush="Black" >
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                    <GradientStop x:Name="ElementBackgroundGradient1" Color="#FF6593CF"/>
                                    <GradientStop x:Name="ElementBackgroundGradient2" Color="#FF6593CF" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <dxmi:AgMenuItemContentPresenter x:Name="ElementContentPresenter"
                        Grid.Column="1"
          Foreground="LightGray"
          CheckAreaVisibility = "{TemplateBinding CheckAreaVisibility}"
          Header="{TemplateBinding Header}"
          HeaderTemplate="{TemplateBinding HeaderTemplate}"
          Icon="{TemplateBinding Icon}"
          IsRadioItem="{TemplateBinding IsRadioItem}"
          MenuOrientation="{TemplateBinding MenuOrientation}"
          Padding="7,2,4,2"
          Template="{StaticResource AgMenuItem;Horizontal;ContentPresenter;DarkRoom}"
          VerticalAlignment="Center"
          ViewStyle="{TemplateBinding ViewStyle}"
          Position="{TemplateBinding Position}"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </dxm:AgMenuTemplateListItem.Template>
        </dxm:AgMenuTemplateListItem>

        <!-- Top Menu Item - Vertical (File, Edit etc...) -->
        <dxm:AgMenuTemplateListItem Key="AgMenuItem;Vertical">
            <dxm:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="dxm:AgMenuItem">
                    <Grid x:Name="ElementRoot">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Hot">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementArrowBrush" Storyboard.TargetProperty="Color" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DroppedDown">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#9f0d2d"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#9f0d2d"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementArrowBrush" Storyboard.TargetProperty="Color" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DroppedDownSelected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementArrowBrush" Storyboard.TargetProperty="Color" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="Opacity" To=".4"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementArrowBrush" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border HorizontalAlignment="Stretch" Grid.ColumnSpan="1" BorderThickness="0,0,2,0" BorderBrush="Black">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                    <GradientStop x:Name="ElementBackgroundGradient1" Color="#FF6593CF"/>
                                    <GradientStop x:Name="ElementBackgroundGradient2" Color="#FF6593CF" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Border x:Name="ElementTopBorder" Height="1" HorizontalAlignment="Stretch" Grid.Row="0" Background="#9f0d2d"/>
                                <Grid Grid.Row="1">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <dxmi:AgMenuItemContentPresenter x:Name="ElementContentPresenter" Grid.Column="0"
                      Foreground="#2D2D2D"
                      CheckAreaVisibility="{TemplateBinding CheckAreaVisibility}"
      Header="{TemplateBinding Header}"
      HeaderTemplate="{TemplateBinding HeaderTemplate}"
      Icon="{TemplateBinding Icon}"
      IsRadioItem="{TemplateBinding IsRadioItem}"
      MenuOrientation="{TemplateBinding MenuOrientation}"
      Padding="11,4,24,5"
      Template="{StaticResource AgMenuItem;Vertical;ContentPresenter;DarkRoom}"
      VerticalAlignment="Top"
      ViewStyle="{TemplateBinding ViewStyle}"
      Position="{TemplateBinding Position}"/>
                                    <dxms:AgMenuSubItemArrowDefaultStyleHelper  Grid.Column="1" Margin="0,0,7,1">
                                        <dxms:AgMenuSubItemArrowDefaultStyleHelper.Background>
                                            <SolidColorBrush x:Name="ElementArrowBrush" Color="#9f0d2d"/>
                                        </dxms:AgMenuSubItemArrowDefaultStyleHelper.Background>
                                    </dxms:AgMenuSubItemArrowDefaultStyleHelper>
                                </Grid>
                                <Border Height="1" HorizontalAlignment="Stretch" Grid.Row="2" VerticalAlignment="Bottom" Background="#9f0d2d"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </dxm:AgMenuTemplateListItem.Template>
        </dxm:AgMenuTemplateListItem>

        <!-- Sub Menu Item (File|New, File|Exit etc...) -->
        <dxm:AgMenuTemplateListItem Key="AgMenuItem;Vertical;PopupMenuItem">
            <dxm:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="dxm:AgMenuItem">
                    <Grid x:Name="ElementRoot">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Hot">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#FFBFDBFF"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#FFBFDBFF"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementIconBackground" Storyboard.TargetProperty="Color" To="#FFBFDBFF"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DroppedDown"/>
                                <VisualState x:Name="DroppedDownSelected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementIconBackground" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="Opacity" To=".4"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementIconBackground" Storyboard.TargetProperty="Color" To="White"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border HorizontalAlignment="Left" Width="26" >
                            <Border.Background>
                                <SolidColorBrush x:Name="ElementIconBackground" Color="White"/>
                            </Border.Background>
                        </Border>

                        <Border HorizontalAlignment="Stretch" Margin="26,0,0,0"
      Width="Auto" BorderThickness="0">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                    <GradientStop x:Name="ElementBackgroundGradient1"
          Color="White"/>
                                    <GradientStop x:Name="ElementBackgroundGradient2"
          Color="White" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                        </Border>

                        <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" Width="Auto" Padding="0">
                            <dxmi:AgMenuItemContentPresenter x:Name="ElementContentPresenter"
          Foreground="{TemplateBinding Foreground}"
          CheckAreaVisibility="{TemplateBinding CheckAreaVisibility}"
          Header="{TemplateBinding Header}"
          HeaderTemplate="{TemplateBinding HeaderTemplate}"
          Icon="{TemplateBinding Icon}"
          IsRadioItem="{TemplateBinding IsRadioItem}"
          Margin="4,0,30,0"
                      MinHeight="22"
                      VerticalAlignment="Center"
          MenuOrientation="{TemplateBinding MenuOrientation}"
          Template="{StaticResource AgMenuItem;Vertical;PopupMenuItemContentPresenter;DarkRoom}"
          ViewStyle="{TemplateBinding ViewStyle}"
          Position="{TemplateBinding Position}"/>
                        </Border>

                    </Grid>
                </ControlTemplate>
            </dxm:AgMenuTemplateListItem.Template>
        </dxm:AgMenuTemplateListItem>

        <!-- Sub Menu Item (File|New|Project.., File|New|Web Site etc...) -->
        <dxm:AgMenuTemplateListItem Key="AgMenuItem;Vertical;PopupMenuSubItem">
            <dxm:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="dxm:AgMenuItem">
                    <Grid x:Name="ElementRoot">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Hot">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementIconBackground" Storyboard.TargetProperty="Color" To="White"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DroppedDown"/>
                                <VisualState x:Name="DroppedDownSelected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementIconBackground" Storyboard.TargetProperty="Color" To="White"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="Opacity" To=".4"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementIconBackground" Storyboard.TargetProperty="Color" To="White"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border HorizontalAlignment="Left" Width="26">
                            <Border.Background>
                                <SolidColorBrush x:Name="ElementIconBackground" Color="White"/>
                            </Border.Background>
                        </Border>
                        <Border HorizontalAlignment="Stretch" Margin="26,0,0,0" Width="Auto">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                    <GradientStop x:Name="ElementBackgroundGradient1" Color="White"/>
                                    <GradientStop x:Name="ElementBackgroundGradient2" Color="White" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                        </Border>

                        <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" Width="Auto" Padding="4,2,4,2">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <dxmi:AgMenuItemContentPresenter
                        x:Name="ElementContentPresenter" Grid.Column="0"
          Foreground="{TemplateBinding Foreground}"
          CheckAreaVisibility="{TemplateBinding CheckAreaVisibility}"
          Header="{TemplateBinding Header}"
          HeaderTemplate="{TemplateBinding HeaderTemplate}"
          Icon="{TemplateBinding Icon}"
          IsRadioItem="{TemplateBinding IsRadioItem}"
          Margin="0,0,30,0"
          MenuOrientation="{TemplateBinding MenuOrientation}"
          Template="{StaticResource Vertical;PopupMenuSubItemContentPresenter;Darkroom}"
          ViewStyle="{TemplateBinding ViewStyle}"
          Position="{TemplateBinding Position}"/>
                                <!--<Path x:Name="BlackTriangle"
          Stretch="Fill" Fill="Black"
          Data="F1 M 394,286L 400,283L 400,282L 394,279L 394,286 Z " Height="7" Width="6" Grid.Column="1"/>-->
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </dxm:AgMenuTemplateListItem.Template>
        </dxm:AgMenuTemplateListItem>

        <dxm:AgMenuTemplateListItem Key="AgMenuSeparator;Vertical;PopupMenuItem">
            <dxm:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="dxm:AgMenuSeparator">
                    <Grid>
                        <Border Background="#FFE9EEEE" HorizontalAlignment="Left"
                        Width="26">
                        </Border>
                        <Grid Margin="26,0,0,0">
                            <Border Height="1" Margin="8,1,8,0" Background="#FF9AC6FF" BorderThickness="0,0,0,0"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </dxm:AgMenuTemplateListItem.Template>
        </dxm:AgMenuTemplateListItem>
    </dxm:AgMenuTemplateList>

    <ControlTemplate TargetType="dxm:AgPopupMenu" x:Key="AgPopupMenuTemplate;DarkRoom">
        <Grid>
            <Grid Margin="0,0,0,0">
                <Border Background="Black" />
                <dxms:AgSubMenuDefaultStyleHelper Background="Black"/>
                <Border Background="Black" Margin="1,1,1,1">
                    <dxmi:AgMenuScrollViewer x:Name="ItemsPresenterContainer"
                      ScrollButtonClickMode="{TemplateBinding ScrollButtonClickMode}" Margin="0,0,0,0">
                        <ItemsPresenter/>
                    </dxmi:AgMenuScrollViewer>
                </Border>
            </Grid>
        </Grid>
    </ControlTemplate>

    <Style TargetType="dxm:AgPopupMenu" x:Key="AgPopupMenu;DarkRoom">
        <Setter Property="Template" Value="{StaticResource AgPopupMenuTemplate;DarkRoom}"/>
        <Setter Property="ItemContainerTemplates" Value="{StaticResource ItemContainerTemplates;DarkRoom}"/>
    </Style>

    <Style TargetType="dxm:AgMenu" x:Key="AgMenu;DarkRoom">
        <Setter Property="Templates" Value="{StaticResource TemplateCollection;DarkRoom}"/>
        <Setter Property="ItemContainerTemplates" Value="{StaticResource ItemContainerTemplates;DarkRoom}"/>
        <Setter Property="SubMenuStyle" Value="{StaticResource AgPopupMenu;DarkRoom}"/>
    </Style>

</ResourceDictionary>

No comments:

Post a Comment