Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Style x:Key="CustomMenuI" TargetType="{x:Type MenuItem}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type MenuItem}">
- <Border x:Name="templateRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
- <Grid VerticalAlignment="Center">
- <ContentPresenter ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Center"/>
- <Popup x:Name="PART_Popup" AllowsTransparency="True" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}">
- <Border Width="95" x:Name="SubMenuBorder" BorderBrush="#353535" BorderThickness="1" Background="#262626" Padding="0">
- <ScrollViewer x:Name="SubMenuScrollViewer" Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}">
- <Grid RenderOptions.ClearTypeHint="Enabled">
- <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" Grid.IsSharedSizeScope="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle"/>
- </Grid>
- </ScrollViewer>
- </Border>
- </Popup>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSuspendingPopupAnimation" Value="True">
- <Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
- </Trigger>
- <Trigger Property="IsHighlighted" Value="True">
- <!--This is for the colour on hover-->
- <Setter Property="Background" TargetName="templateRoot" Value="#232323"/>
- <Setter Property="BorderBrush" TargetName="templateRoot" Value="#282828"/>
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="#FF707070"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement