Код:
<Button Style="{StaticResource HPForegroundStyle}" IsTabStop="False"
Command="{Binding ForegroundPhoneCommand}" Click="Button_Click">
<Button.ContextMenu>
<ContextMenu ItemsSource="{Binding OptionsMenuItemList}" ItemContainerStyle="{StaticResource ContextMenuItemStyle}"
IsOpen="{Binding IsMenuOpen}"
PlacementTarget="{Binding RelativeSourc={RelativeSource AncestorType={x:Type Button}}}">
</ContextMenu>
</Button.ContextMenu>
</Button>
Я использую шаблон MVVM. В ViewModel у меня есть свойство IsMenuOpen, которое управляет открытием контекстного меню и закрытием. Проблема в том, что я могу отключить правый щелчок и не могу отображать контекстное меню при левом щелчке.