Skip to main content

All Questions

1 vote
1 answer
600 views

WPF ContextMenu: MenuItem Icon visibility binding error

This is the style for my ContextMenu: <Style x:Key="DIOStyle" TargetType="ContentControl"> <Setter Property="Tag" Value="{Binding Content,RelativeSource={RelativeSource Mode=Self}}"/&...
rmbq's user avatar
  • 425
0 votes
1 answer
295 views

Show/Hide all datagrid columns from datacontext wpf

I need to change the Datagrid columns visibility from context menu inside the header. All the columns visibility were set inside the XAML code by default. <DataGridTextColumn Visibility="Visible" ...
IBRA's user avatar
  • 1,692
4 votes
1 answer
5k views

ContextMenu items Visibility

I have some ContextMenu With some menuItems. One of the menuItems is "Add Item...". when the user will selects this item, he should see submenu with list of available items; here is description of my ...
leonnoah's user avatar
  • 119
4 votes
4 answers
5k views

WPF - Do not show Context menu when ListView is empty

I have a ContextMenu bind to ListView, but I don't want to be the menu shown when the ListView is empty. I tried direct binding to element, tried binding using FindAncestor, but none of these works ...
George Hx's user avatar
1 vote
3 answers
1k views

WPF ContextMenu bind some property to another property of the same control

I have a ContextMenu and a ColumnHeaderStyle defined in Window.Resource section which I use-it to a DataGrid ColumnHeader. My code is something like this: <ContextMenu x:Key="cm_columnHeaderMenu"/&...
user366113's user avatar
8 votes
1 answer
8k views

Bind ContextMenu's MenuItem visibility to ListView selection

I have a user control with a ListView containing simple items from an ObservableCollection. I would like the ContextMenu of that ListView to contain items depending on what's selected in the ListView. ...
fury's user avatar
  • 607