https://github.com/gaoyifei1011/winui3windowmenustyle
基于 WinUI 风格的窗口菜单实现
https://github.com/gaoyifei1011/winui3windowmenustyle
Last synced: about 1 month ago
JSON representation
基于 WinUI 风格的窗口菜单实现
- Host: GitHub
- URL: https://github.com/gaoyifei1011/winui3windowmenustyle
- Owner: Gaoyifei1011
- License: mit
- Created: 2024-07-25T06:20:45.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-08-01T03:16:20.000Z (9 months ago)
- Last Synced: 2025-03-18T20:47:56.533Z (about 1 month ago)
- Language: C#
- Size: 53.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WinUI3WindowMenuStyle
----------
### 基于 WinUI 风格的窗口菜单实现
### Based on WinUI style window menu implementation
----------
#### 目前在 WinUI 3 框架中,我们可以通过 ExtendsContentIntoTitlebar 属性来自定义标题栏,然而在自定义标题栏后,点击窗口右键,窗口菜单还是 Win32 样式的。所以在本项目中,我们提供了一种基于 WinUI 风格的窗口菜单实现。
#### At present in the frame of the WinUI 3, we can through ExtendsContentIntoTitlebar properties to customize the title bar, however after a custom title bar, right click on the window, the window menu or Win32 style. So in this project, we provide a WinUI-style window menu implementation.
----------
#### 其他说明
##### 1.需要设置 ExtendsContentIntoTitlebar = true 才能正常启用 WinUI 风格的窗口菜单
##### 2.显示窗口菜单时,不仅需要处理鼠标或触摸屏/笔发出的操作,还需要处理键盘 Alt + Space 的按键操作
----------
#### Other instructions
##### 1. You need to set up ExtendsContentIntoTitlebar = true to enable properly WinUI style window menu
##### 2. When displaying the window menu, you need to process not only the operation of the mouse or touch screen/pen, but also the operation of the Alt + Space key on the keyboard
----------
#### 参考资料(Reference)
> * [使用菜单(Using menus)](https://learn.microsoft.com/windows/win32/menurc/using-menus)
> * [菜单和上下文菜单(Menus and context menus)](https://learn.microsoft.com/windows/apps/design/controls/menus-and-context-menus)
> * [关于菜单(About menus)](https://learn.microsoft.com/windows/win32/menurc/about-menus)
> * [标题栏自定义(Titlebar customization)](https://learn.microsoft.com/zh-cn/windows/apps/develop/title-bar)----------
#### 示例图(Demo)
##### 浅色模式(Light Mode)

##### 深色模式(Dark Mode)
