Hi,
I have a treeview that uses the datatemplate shown below. It has a context menu. I'd like to be able to disable or hide certain items depending on which node in the tree they click on. Is this possible? If so, can someone share some example code of how to do this in an MVVM fashion?
Thanks ... Ed
<
HierarchicalDataTemplate
DataType
=
"{x:Type vm:AttachmentContainer}"
ItemsSource
=
"{Binding Children}"
>
<
TextBlock
Text
=
"{Binding Name}"
>
<
telerik:RadContextMenu.ContextMenu
>
<
telerik:RadContextMenu
Opened
=
"tv_ContextMenuOpened"
>
<
telerik:RadMenuItem
x:Name
=
"icon"
Header
=
"Upload File"
>
<
telerik:RadMenuItem.Icon
><
Image
Source
=
"/Images/Upload.png"
/></
telerik:RadMenuItem.Icon
>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Header
=
"New Folder"
>
<
telerik:RadMenuItem.Icon
>
<
Image
Source
=
"/Images/NewFolder.png"
/>
</
telerik:RadMenuItem.Icon
>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Header
=
"Delete Folder"
>
<
telerik:RadMenuItem.Icon
>
<
Image
Source
=
"/Images/DeleteSmall.png"
/>
</
telerik:RadMenuItem.Icon
>
</
telerik:RadMenuItem
>
</
telerik:RadContextMenu
>
</
telerik:RadContextMenu.ContextMenu
>
</
TextBlock
>
</
HierarchicalDataTemplate
>