This is a migrated thread and some comments may be shown as answers.

Which is the default itemtemplate?

3 Answers 136 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 19 Dec 2011, 03:57 PM
Hello,
I'm tring to use MVVM pattern with RadMenu,I'm almost at... but I'm not able to extract with blend the default itemtemplate for RadMenuItem's itemtemplate.... can someone post it please?
Thanks

3 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 20 Dec 2011, 04:30 PM
Hi Paolo,

There are four types of RadMenuItems and a control template for each of them - TopLevelHeaderTemplate, TopLevelItemTemplate, SubMenuHeaderTemplate, SubMenuitemTemplate. You can get the whole style of the RadMenu from your installation folder, for example: C:\Program Files (x86)\Telerik\RadControls for WPF Q3 2011\Themes\Transparent\Themes\Transparent\Menu.xaml

Hope this helps.

Best wishes,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Michele
Top achievements
Rank 2
answered on 22 Dec 2011, 11:52 AM
Hello Konstantina,I've got the following item in my ViewModel :

public class MenuItemObject : Screen//, ICollection<MenuItemObject>
   {
       public int ID { get; set; }
       public string Descrizione { get; set; }
       public string Tag { get; set; }
       public List<MenuItemObject> Items { get; set; }
 
       public MenuItemObject()
       {
           Items = new List<MenuItemObject>();
       }
   }

If I've no child item I can see them in my Caliburn Micro pattern Menu.... if there're I can't... it's possible to have an MVVM pattern example? should I need to define an ItemTemplateSelector and based on the presence of child item show a type instead of another?
Thanks
Paolo
0
Dani
Telerik team
answered on 27 Dec 2011, 09:58 AM
Hello Paolo,

You do not need to use a selector and manually apply an item template depending on whether your MenuItem has submenu items or not. RadMenu takes care of this automatically.

If you need to use only the default template for RadMenuItem, you can copy the SubMenuItemTemplate and customize it per your requirements.

If your menu ever includes hierarchical items, you will need all four templates for your changes to get applied. I suggest that you use the implicit RadMenuItem style found in the suggested location on your machine and apply it as an ItemContainerStyle including all four templates that it has a reference to.

Hope this helps.

All the best,
Dani
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
Menu
Asked by
Michele
Top achievements
Rank 2
Answers by
Konstantina
Telerik team
Michele
Top achievements
Rank 2
Dani
Telerik team
Share this question
or