Solved

WPF menu resource usage

Posted on 2014-01-27
2
394 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Accepted Solution

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

Author Comment

by:Sid Price
ID: 39815071
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

751 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