Problem with commands on RadContextMenu.

2 posts, 0 answers
  1. Rob
    Rob avatar
    238 posts
    Member since:
    Jan 2009

    Posted 09 Jul 2010 Link to this post

    Hi,

    I previously had a RadMenu working with commands.  Since it was just a one top level item RadMenu, I've attempted to convert it to a ToggleButton with a RadContextMenu.  However my commands have stopped working.  I have hooked up both options to the same ItemTemplateSelector (which assigns the ContainerBinding to the commands) and one works while the other doesn't.  Have I missed something or is there a difference between the ContextMenu and regular Menu?

    <!-- New Way -->
    <ToggleButton Content="Desktop" IsChecked="{Binding IsOpen, ElementName=DesktopItemsContextMenu, Mode=TwoWay}">
       <telerikNavigation:RadContextMenu.ContextMenu>
          <telerikNavigation:RadContextMenu x:Name="DesktopItemsContextMenu"      Placement="Bottom" ItemsSource="{Binding Menu.DesktopItems}"
    ItemTemplateSelector="{StaticResource DesktopDropDownMenu_TemplateSelector}" >
          </telerikNavigation:RadContextMenu>
       </telerikNavigation:RadContextMenu.ContextMenu>
    </ToggleButton>
      
    <!-- Old Way -->
    <telerikNavigation:RadMenu>
       <telerikNavigation:RadMenuItem Header="Desktop" ItemsSource="{Binding Menu.DesktopItems}" ItemTemplateSelector="{StaticResource DesktopDropDownMenu_TemplateSelector}">
       </telerikNavigation:RadMenuItem>
    </telerikNavigation:RadMenu>

    <Rad:ContainerBindingCollection x:Key="ActiveItem_Bindings">
      <Rad:ContainerBinding PropertyName="Icon" Binding="{Binding VectorXaml}" />
      <Rad:ContainerBinding PropertyName="Command" Binding="{Binding DataContext.NavigateToCommand, ElementName=LayoutRoot, Mode=OneWay}" />
      <Rad:ContainerBinding PropertyName="CommandParameter" Binding="{Binding}" />
    </Rad:ContainerBindingCollection>


     
  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 12 Jul 2010 Link to this post

    Hello Rob,

    Do you have a CommandBinding that listen for this command?
    Could you send us working example where we can reproduce it?

    Sincerely yours,
    Hristo
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
Back to Top