diff --git a/src/HyPlayer.App/Helpers/TitleBarHelper.cs b/src/HyPlayer.App/Helpers/TitleBarHelper.cs new file mode 100644 index 0000000..326ba71 --- /dev/null +++ b/src/HyPlayer.App/Helpers/TitleBarHelper.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HyPlayer.Helpers +{ + class TitleBarHelper + { + } +} diff --git a/src/HyPlayer.App/Helpers/WindowHelper.cs b/src/HyPlayer.App/Helpers/WindowHelper.cs index a54d46d..f3590c2 100644 --- a/src/HyPlayer.App/Helpers/WindowHelper.cs +++ b/src/HyPlayer.App/Helpers/WindowHelper.cs @@ -9,6 +9,7 @@ using WinRT.Interop; using HyPlayer.Views.Window; using Microsoft.UI.Windowing; +using WinUIEx; namespace HyPlayer.Helpers { @@ -89,6 +90,8 @@ static public void InitializeTitleBarForWindow(Window window, bool isTallTitleBa static public List ActiveWindows { get { return _activeWindows; } } static private List _activeWindows = new List(); + + static public readonly MainWindow CurrentMainWindow = (MainWindow)CreateWindow(); } } diff --git a/src/HyPlayer.App/Services/ActivationService.cs b/src/HyPlayer.App/Services/ActivationService.cs index 3d0cc1d..3807c37 100644 --- a/src/HyPlayer.App/Services/ActivationService.cs +++ b/src/HyPlayer.App/Services/ActivationService.cs @@ -38,10 +38,10 @@ public async Task OnLaunchedAsync(object ActivateEventArgs) if(ActivatedEventArgs != null) { - Window MainWindow = WindowHelper.CreateWindow(); + Window MainWindow = WindowHelper.CurrentMainWindow; if (ActivatedEventArgs.Kind == ExtendedActivationKind.Launch) { - App.GetService().NavigateTo(typeof(Views.Pages.ErrorPage), ActivateEventArgs); + App.GetService().NavigateTo(typeof(Views.Pages.HomePage), ActivateEventArgs); } MainWindow.Activate(); }