Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
Setting a style on a single element
Swatto
Mar 21 2015 6:41 AM
573
Reply
Hello all,
I am trying to apply a style to a single element (in this case, context menu items) but it is not working, I can make the code work for the entire project but just not for the single ContextMenuItems that I want it to apply to:
Please could you tell me where I am going wrong - this code displays 'System.Windows.Style' in my context menu for some reason.
Thanks for any help
<ContextMenu x:Key="SysTrayMenu">
<Style TargetType="TextBlock">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="TextDecorations" Value="Strikethrough"/>
</Trigger>
</Style.Triggers>
</Style>
<MenuItem Header="Show Window" Command="{Binding ShowWindowCommand}" />
<MenuItem Header="Hide Window" Command="{Binding HideWindowCommand}"/>
<MenuItem Header="Exit" Command="{Binding ExitApplicationCommand}" />
</ContextMenu>
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
[WPF] DispatcherTimer and upgrade label
Getting Combobox Selected Value in WPF