Skip to content

Commit

Permalink
feat: Basic support for AppWindowPresenters in WASM
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Feb 28, 2024
1 parent f907b76 commit 7361828
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.JavaScript;
using System.Text;
using System.Threading.Tasks;

Expand Down
12 changes: 8 additions & 4 deletions src/Uno.UI/UI/Xaml/Window/Native/NativeWindowWrapper.wasm.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using Uno.Disposables;
using Windows.Foundation;
using Windows.UI.Core;
using static __Uno.UI.Xaml.Controls.NativeWindowWrapper;

namespace Uno.UI.Xaml.Controls;

Expand Down Expand Up @@ -36,15 +38,17 @@ internal void RaiseNativeSizeChanged(double width, double height)

protected override void ShowCore() => WindowManagerInterop.WindowActivate();

public bool TryEnterFullScreenMode() => SetFullScreenMode(true);

public void ExitFullScreenMode() => SetFullScreenMode(false);

private bool SetFullScreenMode(bool turnOn) => NativeMethods.SetFullScreenMode(turnOn);

public override string Title
{
get => NativeMethods.GetWindowTitle();
set => NativeMethods.SetWindowTitle(value);
}

protected override IDisposable ApplyFullScreenPresenter()
{
SetFullScreenMode(true);
return Disposable.Create(() => SetFullScreenMode(false));
}
}

0 comments on commit 7361828

Please sign in to comment.