Solved

WPF menu resource usage

Posted on 2014-01-27
2
387 Views
Last Modified: 2014-01-31
I have a ContextMenu resource that needs to be used in three UserControls. It looks like this:

	<ContextMenu x:Key="mnuOverride">
		<MenuItem Header="Show as bits" IsCheckable="True" Name="mnuShowAsBits" />
		<MenuItem Header="Hide Peripheral" Name="mnuHidePeripheral" />
		<Separator />
		<MenuItem Header="View Hidden Peripherals" Name="mnuViewHiddenPeripherals"  />
	</ContextMenu>

Open in new window


One of the menu items needs to be handled in two of the controls and the other two in the third control. How can I do this?

Thanks,
Sid.
0
Comment
Question by:Sid Price
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
Comment Utility
One option is to define different context menus in each user control.
0
 

Author Comment

by:Sid Price
Comment Utility
Yes that is an option, however I was hoping to not have multiple, duplicated, resources. From my research that may be the only option.
Thanks,
Sid.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now