Basic window handling.
This commit is contained in:
@@ -1,18 +1,25 @@
|
||||
using System.Text;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Wino.Core;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Services;
|
||||
|
||||
using Wino.Core.WinUI.Services;
|
||||
using Wino.Views;
|
||||
using WinUIEx;
|
||||
namespace Wino
|
||||
{
|
||||
public partial class App : Application
|
||||
{
|
||||
public static MainWindow MainWindow = new MainWindow();
|
||||
private WindowEx m_Window;
|
||||
private Frame m_ShellFrame;
|
||||
|
||||
public App()
|
||||
{
|
||||
if (WebAuthenticator.CheckOAuthRedirectionActivation()) return;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
Services = ConfigureServices();
|
||||
@@ -29,19 +36,38 @@ namespace Wino
|
||||
_appInitializerService = Services.GetService<IAppInitializerService>();
|
||||
_synchronizerFactory = Services.GetService<IWinoSynchronizerFactory>();
|
||||
_translationService = Services.GetService<ITranslationService>();
|
||||
_appShellService = Services.GetService<IAppShellService>();
|
||||
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
}
|
||||
|
||||
protected override async void OnLaunched(LaunchActivatedEventArgs args)
|
||||
{
|
||||
ConfigureWindow();
|
||||
|
||||
_appShellService.AppWindow = m_Window;
|
||||
|
||||
foreach (var service in initializeServices)
|
||||
{
|
||||
await service.InitializeAsync();
|
||||
}
|
||||
|
||||
MainWindow.Activate();
|
||||
MainWindow.StartWino();
|
||||
m_ShellFrame.Navigate(typeof(AppShell));
|
||||
m_Window.Activate();
|
||||
}
|
||||
|
||||
private void ConfigureWindow()
|
||||
{
|
||||
m_Window = new WindowEx
|
||||
{
|
||||
SystemBackdrop = new MicaBackdrop(),
|
||||
ExtendsContentIntoTitleBar = true,
|
||||
MinWidth = 420
|
||||
};
|
||||
|
||||
m_ShellFrame = new Frame();
|
||||
|
||||
m_Window.Content = m_ShellFrame;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Window
|
||||
x:Class="Wino.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Frame x:Name="WindowFrame" />
|
||||
|
||||
</Window>
|
||||
@@ -1,18 +0,0 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
using Wino.Views;
|
||||
|
||||
namespace Wino
|
||||
{
|
||||
public sealed partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void StartWino()
|
||||
{
|
||||
WindowFrame.Navigate(typeof(AppShell));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,15 +8,15 @@
|
||||
IgnorableNamespaces="uap rescap">
|
||||
|
||||
<Identity
|
||||
Name="f531e70c-e2be-4ddb-aa1b-a1e0de9f3ab3"
|
||||
Publisher="CN=bkaan"
|
||||
Name="58272BurakKSE.WPCEx"
|
||||
Publisher="CN=51FBDAF3-E212-4149-89A2-A2636B3BC911"
|
||||
Version="1.0.0.0" />
|
||||
|
||||
<mp:PhoneIdentity PhoneProductId="f531e70c-e2be-4ddb-aa1b-a1e0de9f3ab3" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
<mp:PhoneIdentity PhoneProductId="5f63c5a0-c3a9-4589-97ef-25dad4e4ec10" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
<Properties>
|
||||
<DisplayName>Wino.Mail.WinUI</DisplayName>
|
||||
<PublisherDisplayName>bkaan</PublisherDisplayName>
|
||||
<DisplayName>WPCEx</DisplayName>
|
||||
<PublisherDisplayName>Burak KÖSE</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
|
||||
@@ -42,6 +42,11 @@
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Assets\SmallTile.png" Square310x310Logo="Assets\LargeTile.png"/>
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
</uap:VisualElements>
|
||||
<Extensions>
|
||||
<uap:Extension Category="windows.protocol">
|
||||
<uap:Protocol Name="winomail.app"/>
|
||||
</uap:Extension>
|
||||
</Extensions>
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<UseWinUI>true</UseWinUI>
|
||||
<EnableMsixTooling>true</EnableMsixTooling>
|
||||
<WindowsSdkPackageVersion>10.0.19041.35-preview</WindowsSdkPackageVersion>
|
||||
<GenerateTemporaryStoreCertificate>True</GenerateTemporaryStoreCertificate>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="AppThemes\Custom.xaml" />
|
||||
@@ -99,7 +100,6 @@
|
||||
<Compile Include="..\Wino.Mail\Services\LaunchProtocolService.cs" Link="Services\LaunchProtocolService.cs" />
|
||||
<Compile Include="..\Wino.Mail\Services\PreferencesService.cs" Link="Services\PreferencesService.cs" />
|
||||
<Compile Include="..\Wino.Mail\Services\StatePersistenceService.cs" Link="Services\StatePersistenceService.cs" />
|
||||
<Compile Include="..\Wino.Mail\Services\ToastActivationService.cs" Link="Services\ToastActivationService.cs" />
|
||||
<Compile Include="..\Wino.Mail\Services\WinoNavigationService.cs" Link="Services\WinoNavigationService.cs" />
|
||||
<Compile Include="..\Wino.Mail\Styles\CommandBarItems.xaml.cs" Link="Styles\CommandBarItems.xaml.cs" />
|
||||
<Compile Include="..\Wino.Mail\Views\Account\AccountDetailsPage.xaml.cs" Link="Views\Account\AccountDetailsPage.xaml.cs" />
|
||||
|
||||
Reference in New Issue
Block a user