浏览量:142次
在 Platforms -> Windows 下的 App.xaml.cs 中,可以通过一些反射用法来检索 AppWindow。 然后可以在 appwindow 实例上设置 Title 属性。
In App.xaml.cs under Platforms -> Windows, the AppWindow can be retreived with some reflection usage. The Title property can then be set on the appwindow instance.
usingMicrosoft.UI;usingMicrosoft.UI.Windowing;usingMicrosoft.UI.Xaml;usingWinRT.Interop;protectedoverridevoidOnLaunched(LaunchActivatedEventArgsargs){base.OnLaunched(args);varcurrentWindow=Application.Windows[0].Handler?.PlatformView;IntPtr_windowHandle=WindowNative.GetWindowHandle(currentWindow);varwindowId=Win32Interop.GetWindowIdFromWindow(_windowHandle);AppWindowappWindow=AppWindow.GetFromWindowId(windowId);appWindow.Title="Title!";}引用来源 https://stackoverflow.com/questions/70258689/how-to-set-window-title-for-a-maui-blazor-app-targeting-windows
[声明]本网转载网络媒体稿件是为了传播更多的信息,此类稿件不代表本网观点,本网不承担此类稿件侵权行为的连带责任。故此,如果您发现本网站的内容侵犯了您的版权,请您的相关内容发至此邮箱【779898168@qq.com】,我们在确认后,会立即删除,保证您的版权。