Hello i have a listbox as a sub item under a xammenu item.
<ig:XamMenuItem Header="item1">
<ListBox ItemsSource="{Binding ExternalClients}" ItemTemplate="{StaticResource DataTemplateUserExternalClients}" SelectedValue="{Binding SelectedExternalClient,Mode=TwoWay}" SelectedValuePath="Key"></ListBox>
</ig:XamMenuItem>
but i dont want my listbox to be covered by the mouseover overlay of the first item.
how to prevent this?
Hello Fredrik,
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I copied the default Style of the XamMenuItem and bound Opacity of the element that is responsible for the highlight (a Rectangle called SelectedIndicator) to the Content of the MenuItem. I also used a converter to determine what opacity to set based on the Content. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Just what i need you.
thank you
Hello Frederik,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Never mind, manage to solve with by having all the button items into a collection, bind it to the menu item source and trigger it from viewmodel
Hello i have another problem that kind of involves the same problem as before
basicly i fill the menu with buttons since i want the item to be disabled due to the state of the command object.
<ig:ContextMenuService.Manager> <ig:ContextMenuManager OpenMode="LeftClick" > <ig:ContextMenuManager.ContextMenu> <ig:XamContextMenu DataContext="{Binding Source={StaticResource dcBridge}, Path=DataContext}" >
<Button Style="{StaticResource ParkaTransparentButtonStyle}" Command="{Binding CommandLogout}" HorizontalAlignment="Stretch">
<TextBlock Margin="12,0,0,0" Text="Test" HorizontalAlignment="Stretch"></TextBlock>
</Button>
</ig:XamContextMenu> </ig:ContextMenuManager.ContextMenu> </ig:ContextMenuManager> </ig:ContextMenuService.Manager>
i have expanded your valueconverter to handle button object
public class cMenuHooverConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (value is ListBox) { return 0; } if (value is Button) { var btn = value as Button; if (!btn.IsEnabled) { return 0; } } return 1; }
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } }.
The issue is that it works fine at launch and init of the page, but when the command object changes, the value converter dosnt get triggered.
any help or advice will be highly appreciated