Skip to content

ModernStandardWindowContextMenu

HO-COOH edited this page Mar 22, 2026 · 2 revisions

ModernStandardWindowContextMenu

Properties (WinUI3 IDL)

Name IsDependencyProperty Description
Window Microsoft.UI.Xaml.Window property.

A modern XAML-based window context menu to replace the traditional win32 menu when you right-click the window titlebar. It supports uses on both Essential:WindowEx and a normal Microsoft.UI.Xaml.Window. The icons are hard-coded glyphs so you get the same appearance on both Windows 10 & Windows 11. It also listens to window style changes, so it shows the correct menu item in whatever window styles your window have.

  • To use with a essential:Window, simply set it to WindowEx.ContextMenu
<essential:WindowEx ...
    <essential:WindowEx.ContextMenu>
        <!--  Simply set it to WindowEx.ContextMenu  -->
        <essential:ModernStandardWindowContextMenu />
    </essential:WindowEx.ContextMenu>
</essential:WindowEx>
  • To use with a Microsoft.UI.Xaml.Window, declare it as a Resource with a x:Name and {x:Bind} to ModernStandardWindowContextMenu.Window property under the first element in the window context
<Window ...>
    <StackPanel>
        <StackPanel.Resources>
            <!--  Simply declare it as resource in your first control of the window  -->
            <essential:ModernStandardWindowContextMenu x:Name="Menu" Window="{x:Bind}" />
        </StackPanel.Resources>
    </StackPanel>
</Window>

Clone this wiki locally