简体   繁体   中英

Per-Monitor DPI-Aware WPF Application versus RibbonWindow

Microsoft recomends to use their C++ code to implement per-Monitor DPI-Awareness in WPF applications, which requires to inherit WPF windows from PerMonitorDPIWindow class. But I also want to use WPF's Ribbon implementation (System.Windows.Controls.Ribbon) with chrome integration, and this requires to inherit windows from RibbonWindow.

What is the easiest way to create per-Monitor DPI-aware window with title-integrated Ribbon in WPF?

.NET 4.6.2 preview recently release Per Monitor DPI Awareness in WPF out of the box. Check out the samples and developer guide on how to use it in your app at :

https://github.com/Microsoft/WPF-Samples/tree/master/PerMonitorDPI

Sorry for the late response!

I think to achieve what you are asking for, you would need to reimplement their C++ to inherit RibbonWindow (as opposed to Window).

There may be an easier way. This open source project by emoacht provides a few different DPI-aware Windows, one of which being the ExtendedWindow, which is a customizable chrome Window. Since a RibbonWindow itself is a Window that integrates Ribbon components with Window Chrome, maybe there is a way to manually achieve that using the ExtendedWindow?

If you happen to figure it out, consider contributing to the WpfMonitorAware project so that we all can make use of DPI-aware RibbonWindows :-)

Lastly - The syntax being used in WpfMonitorAware is specific to Visual Studio 2015 and AFAIK C# 6.0, so you will want to use the latest VS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM