TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Swatto
NA
23
11.1k
Setting a style on a single element
Mar 21 2015 6:41 AM
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>
Reply
Answers (
2
)
[WPF] DispatcherTimer and upgrade label
Getting Combobox Selected Value in WPF