A style intended for type 'MenuItem' cannot be applied to type 'Separator'
问题 I'm working on WPF Window Application which uses ContextMenu . My ContextMenu in XAML (in Window.Resources): <ContextMenu x:Key="menuList" Placement="Bottom" > <ContextMenu.ItemContainerStyle> <Style TargetType="{x:Type MenuItem}"> <Setter Property="Header" Value="{Binding Name}"/> <EventSetter Event="Click" Handler="cm_RefreshChannelNotification"/> <Setter Property="IsChecked" Value="{Binding CFiltered}" /> <Setter Property="IsCheckable" Value="True"/> <Setter Property="StaysOpenOnClick"