Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
785
ContextMenu binding not working
posted

Hi,

 

I'm trying to do binding to the ContextMenu and I can't get anything to display. If I replace the ContextMeny by a regulat Menu, then it works as expected.

 

Here's the XAML that I use:

 

        <igMenu:XamWebMenu ItemsSource="{Binding}">
            <igMenu:XamWebMenu.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Name}"/>
                </DataTemplate>
            </igMenu:XamWebMenu.ItemTemplate>
        </igMenu:XamWebMenu>


        <Image Source="/PopupButtonTest;component/Filter2HS.png" Stretch="None" >
            <igMenu:ContextMenuService.Manager>
                <igMenu:ContextMenuManager ModifierKeys="None" OpenMode="LeftClick">
                    <igMenu:ContextMenuManager.ContextMenu>
                        <igMenu:XamWebContextMenu Placement="AlignedToTheLeft" ItemsSource="{Binding}" >
                            <igMenu:XamWebContextMenu.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Name}"/>
                                </DataTemplate>
                            </igMenu:XamWebContextMenu.ItemTemplate>
                        </igMenu:XamWebContextMenu>
                    </igMenu:ContextMenuManager.ContextMenu>
                </igMenu:ContextMenuManager>
            </igMenu:ContextMenuService.Manager>
        </Image>

Parents
  • 785
    posted

    Update: I used a menu instead to achieve pretty much the same behaviour. It works just as expected:

     

                <igMenu:XamWebMenu Grid.Column="1" HorizontalAlignment="Right" >
                    <igMenu:XamWebMenu.Items>
                        <igMenu:XamWebMenuItem SubmenuPreferredLocation="Left" ItemsSource="{Binding Data}" >
                            <igMenu:XamWebMenuItem.Icon>
                                <Image Source="/WfW.Infrastructure.Silverlight;component/Images/Filter2HS.png" Stretch="Uniform" />
                            </igMenu:XamWebMenuItem.Icon>
                            <igMenu:XamWebMenuItem.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Name}" />
                                </DataTemplate>
                            </igMenu:XamWebMenuItem.ItemTemplate>
                        </igMenu:XamWebMenuItem>
                    </igMenu:XamWebMenu.Items>
                </igMenu:XamWebMenu>

     

    Is the ContextMenu binding broken?

Reply Children