我想強制 MAUI Windows 應用程式的主題,例如用于螢屏截圖目的。在Shell和Application元素不支持RequestedTheme可以與WinUI使用性能。
uj5u.com熱心網友回復:
您可以通過RequestedTheme在專案的 Platforms\Windows 子檔案夾中的 App.xaml 中設定屬性來強制使用主題:
<maui:MauiWinUIApplication
x:Class="NetMaui.WinUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:maui="using:Microsoft.Maui"
RequestedTheme="Light"
xmlns:local="using:NetMaui.WinUI">
</maui:MauiWinUIApplication>
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/404812.html
標籤:
