Customize the appearance style of ContextMenu

<!–Customize the appearance style of ContextMenu–> <Style x:Key=”ContextMenyStyle” TargetType=”{x:Type ContextMenu}”> <Setter Property=”SnapsToDevicePixels” Value=”true”/> <Setter Property=”OverridesDefaultStyle” Value=”true”/> <Setter Property=”Grid.IsSharedSizeScope” Value=”true”/> <Setter Property=”Focusable” Value=”false” /> <Setter Property=”HasDropShadow” Value=”true”/> <Setter Property=”BorderThickness” Value=”{TemplateBinding BorderThickness}” /> <Setter Property=”Template”> <Setter.Value> <ControlTemplate TargetType=”{x:Type ContextMenu}”> <Border Name=”Border” Background=”{DynamicResource BorderBrush}” BorderBrush=”{DynamicResource NormalBorderBrush}” BorderThickness=”1″ > <StackPanel IsItemsHost=”true” KeyboardNavigation.DirectionalNavigation=”Cycle” /> </Border> <ControlTemplate.Triggers> <Trigger Property=”HasDropShadow” Value=”true”> <Setter […]

[Transfer] WPF custom controls and styles (9)-tree control TreeView and menu Menu-ContextMenu

one. Preface Disclaimer: WPF Custom Controls and Styles is a series of articles, which are somewhat related, but most of them are released gradually from simple to complex. The main content of this article: Custom style of menuMenu; Custom style of right-click menu ContextMenu; Custom style of tree control TreeView, and right-click menu implementation. two. […]

[sgContextMenu_v2] Customize the right-click menu based on elementUI, an upgraded version of the right-click menu, support unlimited sub-menus, and customize the menu button icon style, etc. I think the package is in place this time. I strongly recommend copying and using it directly. Don’t spray it if you don’t like it~

Binding event methods support inline definition methods, external method names are passed in as strings Support multi-level submenus, free definition of style If the submenu exceeds the page boundary, it will be automatically positioned in the direction that does not cover the parent menu Copy the source code of sgContextMenu_v2 by yourself [pure original] <template> […]

[Solved] [Solution] The show event of the vue3-contextmenu component cannot get the target DOM node

v-contextmenu is a component that can implement a right-click menu. This component provides the show / hide method, and the official documentation states that the callback parameter of this method is the corresponding VNode ; In actual development, I use show but cannot get the corresponding bound DOM node, the callback function of show event […]