Repository navigation
How to remove title bar and border from maui app #9717
Answered
by
Megasantos
RobertSobral
asked this question in
Q&A
|
I have an app made in wpf that I'm migrating to maui, but I haven't found any way to remove the title bar and borders from the app. In wpf I used WindowStyle="None" https://docs.microsoft.com/en-us/dotnet/api/system.windows.windowstyle?view=windowsdesktop-6.0 How can I remove the title bar and borders from my maui app? |
Answered by
Megasantos
Aug 28, 2022
Replies: 1 comment 1 reply
|
Yes it is possible to do this, follow the example below builder.ConfigureLifecycleEvents(events =>
{
events.AddWindows(windows =>
{
windows.OnWindowCreated(window =>
{
IntPtr nativeWindowHandle = WinRT.Interop.WindowNative.GetWindowHandle(window);
WindowId nativeWindowId = Win32Interop.GetWindowIdFromWindow(nativeWindowHandle);
AppWindow appWindow = AppWindow.GetFromWindowId(nativeWindowId);
var p = appWindow.Presenter as OverlappedPresenter;
window.ExtendsContentIntoTitleBar = false;
p.SetBorderAndTitleBar(false, false);
});
});
}); |
1 reply
Answer selected by
RobertSobral
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes it is possible to do this, follow the example below