Home > Programming, Silverlight > Silverlight 4 Custom MenuItem Control with Sub Items

Silverlight 4 Custom MenuItem Control with Sub Items


In this post I tackle an inherent problem everyone faces with the Silverlight 4 Toolkit MenuItem.

Fact is that the toolkit MenuItem OnItemsChanged method throws NotImplementedException…meaning NO subitems for a ContextMenu.

To solve this annoying issue I decide to create my own SuperMenuItem on steroids. My control implements the OnItemsChanged and also borrows some visual tricks from it’s older brother MenuItem on the WPF side.

Luckily the code wasn’t too complex. It needs a bit of brushing up and one more thing..it supports reliably only 1 level of subitems.

Enjoy! and happy coding 😉

Source code: here

Advertisements
  1. Radu Olaru
    19/06/2010 at 9:47 am

    Wow, man. You really did it 😀

  2. Soni Somarajan
    11/04/2011 at 3:27 pm

    Nice… was looking for something similar .. thank you

  3. Martin
    07/02/2012 at 11:21 am

    Good job

  4. noName
    26/03/2012 at 3:25 pm

    Hi ,
    I implement your code in my project , but popup object is always returned null. By the way , the style of popup control is defined in the xaml of user control which I will use in it. Why popup returns null ?
    Thanks for the reply..

  1. 02/01/2011 at 2:12 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: