how can i pass a contextmenuitem to command parameter?

2 posts, 0 answers
  1. Ye
    Ye avatar
    25 posts
    Member since:
    Aug 2012

    Posted 23 Aug 2012 Link to this post

    <telerik:RadContextMenu.ContextMenu>
                                        <telerik:RadContextMenu>
                                            <telerik:RadMenuItem Header="{Binding Path=AppStrings.ObjectBrowserWindow_AddShortCut, Source={StaticResource ResWrapper}}" Command="{Binding AddShortCutCommand}" >
                                                <i:Interaction.Behaviors>
                                                    <Behaviors:SetGridItemAsCommandParameter />
                                                </i:Interaction.Behaviors>
                                            </telerik:RadMenuItem>
                                            <telerik:RadMenuItem Header="{Binding Path=AppStrings.ObjectBrowserWindow_RemoveShortCut, Source={StaticResource ResWrapper}}" Command="{Binding RemoveShortCutCommand}" >
                                                <i:Interaction.Behaviors>
                                                    <Behaviors:SetGridItemAsCommandParameter />
                                                </i:Interaction.Behaviors>
                                            </telerik:RadMenuItem>
                                        </telerik:RadContextMenu>
                                    </telerik:RadContextMenu.ContextMenu>
    
    
    i use behaviors, but sometimes it caused system stackoverflowexception.
     is there any way to bind the radmenuitem to command parameter? 
    
    
    
  2. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 27 Aug 2012 Link to this post

    Hi,

    We are not exactly sure of your idea and what do you want to achieve, but we have created a simple project to illustrate our idea. Please check it and if this i not the behavior you want, send us a project or give us more details what is your problem.
    We were wondering - how did you implement the Behavior: "SetGridItemAsCommandParameter" - did you use Blend or something else?

    Hopefully the attached project helps.

    All the best,
    Rosen Vladimirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top