I'm working with a xamdatagrid and I'm having an issue biding the visibility of a MenuItem in a ContextMenu
This is the code I have
<igDP:XamDataGrid.ContextMenu>
<MenuItem Header="{Binding Path=AnalystSignOffCommandVM.DisplayName}" Visibility="{Binding Path=IsMeDay, Converter={StaticResource booleanToVisibilityConverter }}" Command="{Binding Path=AnalystSignOffCommandVM.Command}">
<MenuItem.Icon>
<Image Source="{StaticResource AcceptSmallIcon}" />
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
When IsMeDay is a bool type property of the Viewmodel.
I tried this approach too without any luck.
<MenuItem Header="{Binding Path=AnalystSignOffCommandVM.DisplayName}" Visibility="{Binding Path=SignOffMenuItemVisibility}" Command="{Binding Path=AnalystSignOffCommandVM.Command}">
<Image Source="{StaticResource RejectSmallIcon}" />
Can you please help on this one?
Thanks in advance
Hello,
Thank you for your post. I have been looking through it and the code you have provided and I created a sample project, which demonstrates how to achieve your goal. Also if you have only one MenuItem I suggest you bind the ContextMenu’s Visibility Property to the IsMeDay Property instead of MenuItem's, and if you have many than you can do it like in your code. Please let me know if you need further clarification on this matter.
Looking forward for your reply.
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Yes I was be able to fix the issue I had, is wokring fine now.
Thanks for the response.