Как установить режим окна по умолчанию в полный экран в Winui 3? ⇐ C#
-
Anonymous
Как установить режим окна по умолчанию в полный экран в Winui 3?
namespace MyApp
{
public sealed partial class MainWindow : Window
{
AppWindow m_appWindow;
public MainWindow()
{
this.InitializeComponent();
m_appWindow = GetAppWindowForCurrentWindow();
}
private AppWindow GetAppWindowForCurrentWindow()
{
IntPtr hWnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
WindowId myWndId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(hWnd);
return AppWindow.GetFromWindowId(myWndId);
}
private void SwitchPresenter_FullScreen(object sender, RoutedEventArgs e)
{
m_appWindow.SetPresenter(AppWindowPresenterKind.FullScreen);
}
}
}
< /code>
switchpresenter_fullScreen Функция работает работает, но как я могу установить режим окна по умолчанию моего приложения на полный экран? Могу ли я позвонить в SwitchPresenter_fullScreen во время запуска приложения?
Подробнее здесь: https://stackoverflow.com/questions/732 ... in-winui-3
namespace MyApp
{
public sealed partial class MainWindow : Window
{
AppWindow m_appWindow;
public MainWindow()
{
this.InitializeComponent();
m_appWindow = GetAppWindowForCurrentWindow();
}
private AppWindow GetAppWindowForCurrentWindow()
{
IntPtr hWnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
WindowId myWndId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(hWnd);
return AppWindow.GetFromWindowId(myWndId);
}
private void SwitchPresenter_FullScreen(object sender, RoutedEventArgs e)
{
m_appWindow.SetPresenter(AppWindowPresenterKind.FullScreen);
}
}
}
< /code>
switchpresenter_fullScreen Функция работает работает, но как я могу установить режим окна по умолчанию моего приложения на полный экран? Могу ли я позвонить в SwitchPresenter_fullScreen во время запуска приложения?
Подробнее здесь: https://stackoverflow.com/questions/732 ... in-winui-3