Initial WinUI switch.
@@ -3,21 +3,20 @@
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageVersion Include="ColorHashSharp" Version="1.0.0" />
|
||||
<PackageVersion Include="ColorHashSharp" Version="1.1.0" />
|
||||
<PackageVersion Include="CommunityToolkit.Common" Version="8.4.0" />
|
||||
<PackageVersion Include="CommunityToolkit.Diagnostics" Version="8.4.0" />
|
||||
<PackageVersion Include="CommunityToolkit.Labs.Uwp.Controls.MarkdownTextBlock" Version="0.1.250206-build.2040" />
|
||||
<PackageVersion Include="CommunityToolkit.Labs.Uwp.DependencyPropertyGenerator" Version="0.1.250206-build.2040" />
|
||||
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||
<PackageVersion Include="CommunityToolkit.Uwp.Animations" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.Uwp.Behaviors" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.Uwp.Controls.Segmented" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.Uwp.Controls.SettingsControls" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.Uwp.Controls.Sizers" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.Uwp.Controls.TabbedCommandBar" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.Uwp.Controls.TokenizingTextBox" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.Uwp.Extensions" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.Uwp.Controls.Primitives" Version="8.2.250129-preview2" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Animations" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.TabbedCommandBar" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.TokenizingTextBox" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Extensions" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.Labs.WinUI.Controls.MarkdownTextBlock" Version="0.1.250926-build.2293" />
|
||||
<PackageVersion Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />
|
||||
<PackageVersion Include="CommunityToolkit.Labs.WinUI.DependencyPropertyGenerator" Version="0.1.250926-build.2293" />
|
||||
<PackageVersion Include="EmailValidation" Version="1.3.0" />
|
||||
<PackageVersion Include="gravatar-dotnet" Version="0.1.3" />
|
||||
<PackageVersion Include="HtmlAgilityPack" Version="1.12.0" />
|
||||
@@ -25,21 +24,21 @@
|
||||
<PackageVersion Include="IsExternalInit" Version="1.0.3" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.13.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.4" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" />
|
||||
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.4" />
|
||||
<PackageVersion Include="Microsoft.Graph" Version="5.75.0" />
|
||||
<PackageVersion Include="Microsoft.Identity.Client" Version="4.70.1" />
|
||||
<PackageVersion Include="Microsoft.Graphics.Win2D" Version="1.3.2" />
|
||||
<PackageVersion Include="Microsoft.Identity.Client" Version="4.77.1" />
|
||||
<PackageVersion Include="Microsoft.Identity.Client.Broker" Version="4.70.1" />
|
||||
<PackageVersion Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.70.1" />
|
||||
<PackageVersion Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.14" />
|
||||
<PackageVersion Include="Microsoft.UI.Xaml" Version="2.8.7" />
|
||||
<PackageVersion Include="Microsoft.Xaml.Behaviors.Uwp.Managed" Version="3.0.0" />
|
||||
<PackageVersion Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="3.0.0" />
|
||||
<PackageVersion Include="MimeKit" Version="4.11.0" />
|
||||
<PackageVersion Include="morelinq" Version="4.4.0" />
|
||||
<PackageVersion Include="Nito.AsyncEx" Version="5.1.2" />
|
||||
<PackageVersion Include="Nito.AsyncEx.Tasks" Version="5.1.2" />
|
||||
<PackageVersion Include="NodaTime" Version="3.2.2" />
|
||||
<PackageVersion Include="Sentry.Serilog" Version="5.12.0" />
|
||||
<PackageVersion Include="Sentry.Serilog" Version="5.15.1" />
|
||||
<PackageVersion Include="Serilog" Version="4.2.0" />
|
||||
<PackageVersion Include="Serilog.Exceptions" Version="8.4.0" />
|
||||
<PackageVersion Include="Serilog.Sinks.Debug" Version="3.0.0" />
|
||||
@@ -51,7 +50,6 @@
|
||||
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
|
||||
<PackageVersion Include="System.Text.Encoding.CodePages" Version="9.0.4" />
|
||||
<PackageVersion Include="System.Text.Json" Version="9.0.4" />
|
||||
<PackageVersion Include="Win2D.uwp" Version="1.28.2" />
|
||||
<PackageVersion Include="H.NotifyIcon.Wpf" Version="2.3.0" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Notifications" Version="7.1.2" />
|
||||
<PackageVersion Include="Google.Apis.Auth" Version="1.69.0" />
|
||||
@@ -64,5 +62,8 @@
|
||||
<PackageVersion Include="System.Reactive" Version="6.0.1" />
|
||||
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.4" />
|
||||
<PackageVersion Include="System.Text.Encodings.Web" Version="9.0.4" />
|
||||
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.6584" />
|
||||
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.8.250916003" />
|
||||
<PackageVersion Include="WinUIEx" Version="2.8.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,6 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
|
||||
<RootNamespace>Wino.Authentication</RootNamespace>
|
||||
<Platforms>x86;x64;arm64</Platforms>
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Wino.Core.Domain.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// An exception thrown when the background task registration is failed.
|
||||
/// </summary>
|
||||
public class BackgroundTaskRegistrationFailedException : Exception { }
|
||||
@@ -1,17 +0,0 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Wino.Core.Domain.Interfaces;
|
||||
|
||||
public interface IBackgroundTaskService
|
||||
{
|
||||
/// <summary>
|
||||
/// Unregisters all background tasks once.
|
||||
/// This is used to clean up the background tasks when the app is updated.
|
||||
/// </summary>
|
||||
void UnregisterAllBackgroundTask();
|
||||
|
||||
/// <summary>
|
||||
/// Registers required background tasks.
|
||||
/// </summary>
|
||||
Task RegisterBackgroundTasksAsync();
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Core;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Core.UWP;
|
||||
|
||||
public class UWPDispatcher : IDispatcher
|
||||
{
|
||||
private readonly CoreDispatcher _coreDispatcher;
|
||||
|
||||
public UWPDispatcher(CoreDispatcher coreDispatcher)
|
||||
{
|
||||
_coreDispatcher = coreDispatcher;
|
||||
}
|
||||
|
||||
public Task ExecuteOnUIThread(Action action)
|
||||
=> _coreDispatcher.RunAsync(CoreDispatcherPriority.Normal, () => action()).AsTask();
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Composition;
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
namespace Wino.Extensions;
|
||||
|
||||
public static partial class CompositionExtensions
|
||||
{
|
||||
public static void StartSizeAnimation(this UIElement element, Vector2? from = null, Vector2? to = null,
|
||||
double duration = 800, int delay = 0, CompositionEasingFunction easing = null, Action completed = null,
|
||||
AnimationIterationBehavior iterationBehavior = AnimationIterationBehavior.Count)
|
||||
{
|
||||
CompositionScopedBatch batch = null;
|
||||
|
||||
var visual = element.Visual();
|
||||
var compositor = visual.Compositor;
|
||||
|
||||
if (completed != null)
|
||||
{
|
||||
batch = compositor.CreateScopedBatch(CompositionBatchTypes.Animation);
|
||||
batch.Completed += (s, e) => completed();
|
||||
}
|
||||
|
||||
if (to == null)
|
||||
{
|
||||
to = Vector2.One;
|
||||
}
|
||||
|
||||
visual.StartAnimation("Size",
|
||||
compositor.CreateVector2KeyFrameAnimation(from, to.Value, duration, delay, easing, iterationBehavior));
|
||||
|
||||
batch?.End();
|
||||
}
|
||||
|
||||
public static void StartSizeAnimation(this Visual visual, Vector2? from = null, Vector2? to = null,
|
||||
double duration = 800, int delay = 0, CompositionEasingFunction easing = null, Action completed = null,
|
||||
AnimationIterationBehavior iterationBehavior = AnimationIterationBehavior.Count)
|
||||
{
|
||||
CompositionScopedBatch batch = null;
|
||||
var compositor = visual.Compositor;
|
||||
|
||||
if (completed != null)
|
||||
{
|
||||
batch = compositor.CreateScopedBatch(CompositionBatchTypes.Animation);
|
||||
batch.Completed += (s, e) => completed();
|
||||
}
|
||||
|
||||
if (to == null)
|
||||
{
|
||||
to = Vector2.One;
|
||||
}
|
||||
|
||||
visual.StartAnimation("Size",
|
||||
compositor.CreateVector2KeyFrameAnimation(from, to.Value, duration, delay, easing, iterationBehavior));
|
||||
|
||||
batch?.End();
|
||||
}
|
||||
|
||||
public static Task StartSizeAnimationAsync(this UIElement element, Vector2? from = null, Vector2? to = null,
|
||||
double duration = 800, int delay = 0, CompositionEasingFunction easing = null,
|
||||
AnimationIterationBehavior iterationBehavior = AnimationIterationBehavior.Count)
|
||||
{
|
||||
CompositionScopedBatch batch;
|
||||
|
||||
var visual = element.Visual();
|
||||
var compositor = visual.Compositor;
|
||||
|
||||
var taskSource = new TaskCompletionSource<bool>();
|
||||
|
||||
void Completed(object o, CompositionBatchCompletedEventArgs e)
|
||||
{
|
||||
batch.Completed -= Completed;
|
||||
taskSource.SetResult(true);
|
||||
}
|
||||
|
||||
batch = compositor.CreateScopedBatch(CompositionBatchTypes.Animation);
|
||||
batch.Completed += Completed;
|
||||
|
||||
if (to == null)
|
||||
{
|
||||
to = Vector2.One;
|
||||
}
|
||||
|
||||
visual.StartAnimation("Size",
|
||||
compositor.CreateVector2KeyFrameAnimation(from, to.Value, duration, delay, easing, iterationBehavior));
|
||||
|
||||
batch.End();
|
||||
|
||||
return taskSource.Task;
|
||||
}
|
||||
|
||||
public static Task StartSizeAnimationAsync(this Visual visual, Vector2? from = null, Vector2? to = null,
|
||||
double duration = 800, int delay = 0, CompositionEasingFunction easing = null,
|
||||
AnimationIterationBehavior iterationBehavior = AnimationIterationBehavior.Count)
|
||||
{
|
||||
CompositionScopedBatch batch;
|
||||
|
||||
var compositor = visual.Compositor;
|
||||
|
||||
var taskSource = new TaskCompletionSource<bool>();
|
||||
|
||||
void Completed(object o, CompositionBatchCompletedEventArgs e)
|
||||
{
|
||||
batch.Completed -= Completed;
|
||||
taskSource.SetResult(true);
|
||||
}
|
||||
|
||||
batch = compositor.CreateScopedBatch(CompositionBatchTypes.Animation);
|
||||
batch.Completed += Completed;
|
||||
|
||||
if (to == null)
|
||||
{
|
||||
to = Vector2.One;
|
||||
}
|
||||
|
||||
visual.StartAnimation("Size",
|
||||
compositor.CreateVector2KeyFrameAnimation(from, to.Value, duration, delay, easing, iterationBehavior));
|
||||
|
||||
batch.End();
|
||||
|
||||
return taskSource.Task;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Serilog;
|
||||
using Windows.ApplicationModel.Background;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Core.UWP.Services;
|
||||
|
||||
public class BackgroundTaskService : IBackgroundTaskService
|
||||
{
|
||||
private const string IsBackgroundTasksUnregisteredKey = nameof(IsBackgroundTasksUnregisteredKey);
|
||||
public const string ToastNotificationActivationHandlerTaskName = "ToastNotificationActivationHandlerTask";
|
||||
|
||||
private readonly IConfigurationService _configurationService;
|
||||
|
||||
public BackgroundTaskService(IConfigurationService configurationService)
|
||||
{
|
||||
_configurationService = configurationService;
|
||||
}
|
||||
|
||||
public void UnregisterAllBackgroundTask()
|
||||
{
|
||||
if (_configurationService.Get(IsBackgroundTasksUnregisteredKey, false))
|
||||
{
|
||||
foreach (var task in BackgroundTaskRegistration.AllTasks)
|
||||
{
|
||||
task.Value.Unregister(true);
|
||||
}
|
||||
|
||||
Log.Information("Unregistered all background tasks.");
|
||||
_configurationService.Set(IsBackgroundTasksUnregisteredKey, true);
|
||||
}
|
||||
}
|
||||
|
||||
public Task RegisterBackgroundTasksAsync()
|
||||
{
|
||||
return RegisterToastNotificationHandlerBackgroundTaskAsync();
|
||||
}
|
||||
|
||||
public async Task RegisterToastNotificationHandlerBackgroundTaskAsync()
|
||||
{
|
||||
// If background task is already registered, do nothing.
|
||||
if (BackgroundTaskRegistration.AllTasks.Any(i => i.Value.Name.Equals(ToastNotificationActivationHandlerTaskName)))
|
||||
return;
|
||||
|
||||
// Otherwise request access
|
||||
BackgroundAccessStatus status = await BackgroundExecutionManager.RequestAccessAsync();
|
||||
|
||||
// Create the background task
|
||||
BackgroundTaskBuilder builder = new BackgroundTaskBuilder()
|
||||
{
|
||||
Name = ToastNotificationActivationHandlerTaskName
|
||||
};
|
||||
|
||||
// Assign the toast action trigger
|
||||
builder.SetTrigger(new ToastNotificationActionTrigger());
|
||||
|
||||
// And register the task
|
||||
BackgroundTaskRegistration registration = builder.Register();
|
||||
}
|
||||
}
|
||||
@@ -12,78 +12,6 @@
|
||||
<SupportedOSPlatformVersion>10.0.18362.0</SupportedOSPlatformVersion>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Assets\FileTypes\type_archive.png" />
|
||||
<None Remove="Assets\FileTypes\type_audio.png" />
|
||||
<None Remove="Assets\FileTypes\type_executable.png" />
|
||||
<None Remove="Assets\FileTypes\type_html.png" />
|
||||
<None Remove="Assets\FileTypes\type_image.png" />
|
||||
<None Remove="Assets\FileTypes\type_none.png" />
|
||||
<None Remove="Assets\FileTypes\type_other.png" />
|
||||
<None Remove="Assets\FileTypes\type_pdf.png" />
|
||||
<None Remove="Assets\FileTypes\type_rar.png" />
|
||||
<None Remove="Assets\FileTypes\type_video.png" />
|
||||
<None Remove="Assets\Providers\Gmail.png" />
|
||||
<None Remove="Assets\Providers\iCloud.png" />
|
||||
<None Remove="Assets\Providers\IMAP4.png" />
|
||||
<None Remove="Assets\Providers\Office 365.png" />
|
||||
<None Remove="Assets\Providers\Outlook.png" />
|
||||
<None Remove="Assets\Providers\Yahoo.png" />
|
||||
<None Remove="Assets\WinoIcons.ttf" />
|
||||
<None Remove="BackgroundImages\Acrylic.jpg" />
|
||||
<None Remove="BackgroundImages\Clouds.jpg" />
|
||||
<None Remove="BackgroundImages\Forest.jpg" />
|
||||
<None Remove="BackgroundImages\Garden.jpg" />
|
||||
<None Remove="BackgroundImages\Mica.jpg" />
|
||||
<None Remove="BackgroundImages\Nighty.jpg" />
|
||||
<None Remove="BackgroundImages\Snowflake.jpg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Remove="AppThemes\Acrylic.xaml" />
|
||||
<Page Remove="AppThemes\Clouds.xaml" />
|
||||
<Page Remove="AppThemes\Custom.xaml" />
|
||||
<Page Remove="AppThemes\Forest.xaml" />
|
||||
<Page Remove="AppThemes\Garden.xaml" />
|
||||
<Page Remove="AppThemes\Mica.xaml" />
|
||||
<Page Remove="AppThemes\Nighty.xaml" />
|
||||
<Page Remove="AppThemes\Snowflake.xaml" />
|
||||
<Page Remove="AppThemes\TestTheme.xaml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="AppThemes\Acrylic.xaml" />
|
||||
<Content Include="AppThemes\Clouds.xaml" />
|
||||
<Content Include="AppThemes\Custom.xaml" />
|
||||
<Content Include="AppThemes\Forest.xaml" />
|
||||
<Content Include="AppThemes\Garden.xaml" />
|
||||
<Content Include="AppThemes\Mica.xaml" />
|
||||
<Content Include="AppThemes\Nighty.xaml" />
|
||||
<Content Include="AppThemes\Snowflake.xaml" />
|
||||
<Content Include="AppThemes\TestTheme.xaml" />
|
||||
<Content Include="Assets\FileTypes\type_archive.png" />
|
||||
<Content Include="Assets\FileTypes\type_audio.png" />
|
||||
<Content Include="Assets\FileTypes\type_executable.png" />
|
||||
<Content Include="Assets\FileTypes\type_html.png" />
|
||||
<Content Include="Assets\FileTypes\type_image.png" />
|
||||
<Content Include="Assets\FileTypes\type_none.png" />
|
||||
<Content Include="Assets\FileTypes\type_other.png" />
|
||||
<Content Include="Assets\FileTypes\type_pdf.png" />
|
||||
<Content Include="Assets\FileTypes\type_rar.png" />
|
||||
<Content Include="Assets\FileTypes\type_video.png" />
|
||||
<Content Include="Assets\Providers\Gmail.png" />
|
||||
<Content Include="Assets\Providers\iCloud.png" />
|
||||
<Content Include="Assets\Providers\IMAP4.png" />
|
||||
<Content Include="Assets\Providers\Office 365.png" />
|
||||
<Content Include="Assets\Providers\Outlook.png" />
|
||||
<Content Include="Assets\Providers\Yahoo.png" />
|
||||
<Content Include="Assets\WinoIcons.ttf" />
|
||||
<Content Include="BackgroundImages\Acrylic.jpg" />
|
||||
<Content Include="BackgroundImages\Clouds.jpg" />
|
||||
<Content Include="BackgroundImages\Forest.jpg" />
|
||||
<Content Include="BackgroundImages\Garden.jpg" />
|
||||
<Content Include="BackgroundImages\Mica.jpg" />
|
||||
<Content Include="BackgroundImages\Nighty.jpg" />
|
||||
<Content Include="BackgroundImages\Snowflake.jpg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="gravatar-dotnet" />
|
||||
<PackageReference Include="Microsoft.Identity.Client" />
|
||||
|
||||
@@ -1,267 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Nito.AsyncEx;
|
||||
using Serilog;
|
||||
using Windows.ApplicationModel;
|
||||
using Windows.ApplicationModel.Activation;
|
||||
using Windows.ApplicationModel.AppService;
|
||||
using Windows.ApplicationModel.Core;
|
||||
using Windows.Foundation.Metadata;
|
||||
using Windows.Globalization;
|
||||
using Windows.Storage;
|
||||
using Windows.UI;
|
||||
using Windows.UI.Core.Preview;
|
||||
using Windows.UI.ViewManagement;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Wino.Activation;
|
||||
using Wino.Core.Domain;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Models.Translations;
|
||||
using Wino.Messaging.Client.Shell;
|
||||
using Wino.Services;
|
||||
|
||||
namespace Wino.Core.UWP;
|
||||
|
||||
public abstract class WinoApplication : Application, IRecipient<LanguageChanged>
|
||||
{
|
||||
public new static WinoApplication Current => (WinoApplication)Application.Current;
|
||||
public const string WinoLaunchLogPrefix = "[Wino Launch] ";
|
||||
|
||||
public IServiceProvider Services { get; }
|
||||
protected IWinoLogger LogInitializer { get; }
|
||||
protected IApplicationConfiguration AppConfiguration { get; }
|
||||
protected IWinoServerConnectionManager<AppServiceConnection> AppServiceConnectionManager { get; }
|
||||
public IThemeService ThemeService { get; }
|
||||
public IUnderlyingThemeService UnderlyingThemeService { get; }
|
||||
public IThumbnailService ThumbnailService { get; }
|
||||
protected IDatabaseService DatabaseService { get; }
|
||||
protected ITranslationService TranslationService { get; }
|
||||
|
||||
protected WinoApplication()
|
||||
{
|
||||
ConfigurePrelaunch();
|
||||
|
||||
Services = ConfigureServices();
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||
TaskScheduler.UnobservedTaskException += OnUnobservedTaskException;
|
||||
UnhandledException += OnAppUnhandledException;
|
||||
|
||||
Resuming += OnResuming;
|
||||
Suspending += OnSuspending;
|
||||
|
||||
LogInitializer = Services.GetService<IWinoLogger>();
|
||||
AppConfiguration = Services.GetService<IApplicationConfiguration>();
|
||||
|
||||
AppServiceConnectionManager = Services.GetService<IWinoServerConnectionManager<AppServiceConnection>>();
|
||||
ThemeService = Services.GetService<IThemeService>();
|
||||
DatabaseService = Services.GetService<IDatabaseService>();
|
||||
TranslationService = Services.GetService<ITranslationService>();
|
||||
UnderlyingThemeService = Services.GetService<IUnderlyingThemeService>();
|
||||
ThumbnailService = Services.GetService<IThumbnailService>();
|
||||
|
||||
// Make sure the paths are setup on app start.
|
||||
AppConfiguration.ApplicationDataFolderPath = ApplicationData.Current.LocalFolder.Path;
|
||||
AppConfiguration.PublisherSharedFolderPath = ApplicationData.Current.GetPublisherCacheFolder(ApplicationConfiguration.SharedFolderName).Path;
|
||||
AppConfiguration.ApplicationTempFolderPath = ApplicationData.Current.TemporaryFolder.Path;
|
||||
|
||||
ConfigureLogging();
|
||||
}
|
||||
|
||||
private void CurrentDomain_UnhandledException(object sender, System.UnhandledExceptionEventArgs e)
|
||||
=> Log.Fatal(e.ExceptionObject as Exception, "AppDomain Unhandled Exception");
|
||||
|
||||
private void OnUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
|
||||
=> Log.Error(e.Exception, "Unobserved Task Exception");
|
||||
|
||||
private void OnAppUnhandledException(object sender, Windows.UI.Xaml.UnhandledExceptionEventArgs e)
|
||||
{
|
||||
Log.Fatal(e.Exception, "Unhandled Exception");
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
protected abstract void OnApplicationCloseRequested(object sender, SystemNavigationCloseRequestedPreviewEventArgs e);
|
||||
protected abstract IEnumerable<ActivationHandler> GetActivationHandlers();
|
||||
protected abstract ActivationHandler<IActivatedEventArgs> GetDefaultActivationHandler();
|
||||
protected override void OnWindowCreated(WindowCreatedEventArgs args)
|
||||
{
|
||||
base.OnWindowCreated(args);
|
||||
|
||||
ConfigureTitleBar();
|
||||
|
||||
LogActivation($"OnWindowCreated -> IsWindowNull: {args.Window == null}");
|
||||
|
||||
TryRegisterAppCloseChange();
|
||||
}
|
||||
|
||||
public IEnumerable<IInitializeAsync> GetActivationServices()
|
||||
{
|
||||
yield return DatabaseService;
|
||||
yield return TranslationService;
|
||||
yield return ThemeService;
|
||||
}
|
||||
|
||||
public Task InitializeServicesAsync() => GetActivationServices().Select(a => a.InitializeAsync()).WhenAll();
|
||||
|
||||
public bool IsInteractiveLaunchArgs(object args) => args is IActivatedEventArgs;
|
||||
|
||||
public void LogActivation(string log) => Log.Information($"{WinoLaunchLogPrefix}{log}");
|
||||
|
||||
private void ConfigureTitleBar()
|
||||
{
|
||||
var coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
|
||||
var applicationViewTitleBar = ApplicationView.GetForCurrentView().TitleBar;
|
||||
|
||||
// Extend shell content into core window to meet design requirements.
|
||||
coreTitleBar.ExtendViewIntoTitleBar = true;
|
||||
|
||||
// Change system buttons and background colors to meet design requirements.
|
||||
applicationViewTitleBar.ButtonBackgroundColor = Colors.Transparent;
|
||||
applicationViewTitleBar.BackgroundColor = Colors.Transparent;
|
||||
applicationViewTitleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
|
||||
applicationViewTitleBar.ButtonForegroundColor = Colors.White;
|
||||
}
|
||||
|
||||
public async Task ActivateWinoAsync(object args)
|
||||
{
|
||||
await InitializeServicesAsync();
|
||||
|
||||
if (IsInteractiveLaunchArgs(args))
|
||||
{
|
||||
if (Window.Current.Content == null)
|
||||
{
|
||||
var mainFrame = new Frame();
|
||||
|
||||
Window.Current.Content = mainFrame;
|
||||
|
||||
await ThemeService.InitializeAsync();
|
||||
}
|
||||
}
|
||||
|
||||
await HandleActivationAsync(args);
|
||||
|
||||
if (IsInteractiveLaunchArgs(args))
|
||||
{
|
||||
Window.Current.Activate();
|
||||
|
||||
LogActivation("Window activated");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task HandleActivationAsync(object activationArgs)
|
||||
{
|
||||
if (GetActivationHandlers() != null)
|
||||
{
|
||||
var activationHandler = GetActivationHandlers().FirstOrDefault(h => h.CanHandle(activationArgs)) ?? null;
|
||||
|
||||
if (activationHandler != null)
|
||||
{
|
||||
await activationHandler.HandleAsync(activationArgs);
|
||||
}
|
||||
}
|
||||
|
||||
if (IsInteractiveLaunchArgs(activationArgs))
|
||||
{
|
||||
var defaultHandler = GetDefaultActivationHandler();
|
||||
|
||||
if (defaultHandler.CanHandle(activationArgs))
|
||||
{
|
||||
await defaultHandler.HandleAsync(activationArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override async void OnLaunched(LaunchActivatedEventArgs args)
|
||||
{
|
||||
LogActivation($"OnLaunched -> {args.GetType().Name}, Kind -> {args.Kind}, PreviousExecutionState -> {args.PreviousExecutionState}, IsPrelaunch -> {args.PrelaunchActivated}");
|
||||
|
||||
if (!args.PrelaunchActivated)
|
||||
{
|
||||
await ActivateWinoAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
protected override async void OnFileActivated(FileActivatedEventArgs args)
|
||||
{
|
||||
base.OnFileActivated(args);
|
||||
|
||||
LogActivation($"OnFileActivated -> ItemCount: {args.Files.Count}, Kind: {args.Kind}, PreviousExecutionState: {args.PreviousExecutionState}");
|
||||
|
||||
await ActivateWinoAsync(args);
|
||||
}
|
||||
|
||||
protected override async void OnActivated(IActivatedEventArgs args)
|
||||
{
|
||||
base.OnActivated(args);
|
||||
|
||||
Log.Information($"OnActivated -> {args.GetType().Name}, Kind -> {args.Kind}, Prev Execution State -> {args.PreviousExecutionState}");
|
||||
|
||||
await ActivateWinoAsync(args);
|
||||
}
|
||||
|
||||
private void TryRegisterAppCloseChange()
|
||||
{
|
||||
try
|
||||
{
|
||||
var systemNavigationManagerPreview = SystemNavigationManagerPreview.GetForCurrentView();
|
||||
|
||||
systemNavigationManagerPreview.CloseRequested -= OnApplicationCloseRequested;
|
||||
systemNavigationManagerPreview.CloseRequested += OnApplicationCloseRequested;
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void ConfigurePrelaunch()
|
||||
{
|
||||
if (ApiInformation.IsMethodPresent("Windows.ApplicationModel.Core.CoreApplication", "EnablePrelaunch"))
|
||||
CoreApplication.EnablePrelaunch(true);
|
||||
}
|
||||
|
||||
public virtual async void OnResuming(object sender, object e)
|
||||
{
|
||||
// App Service connection was lost on suspension.
|
||||
// We must restore it.
|
||||
// Server might be running already, but re-launching it will trigger a new connection attempt.
|
||||
|
||||
try
|
||||
{
|
||||
await AppServiceConnectionManager.ConnectAsync();
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error(ex, "Failed to connect to server after resuming the app.");
|
||||
}
|
||||
}
|
||||
public virtual void OnSuspending(object sender, SuspendingEventArgs e) { }
|
||||
|
||||
public abstract IServiceProvider ConfigureServices();
|
||||
|
||||
public void ConfigureLogging()
|
||||
{
|
||||
string logFilePath = Path.Combine(ApplicationData.Current.LocalFolder.Path, Constants.ClientLogFile);
|
||||
LogInitializer.SetupLogger(logFilePath);
|
||||
}
|
||||
|
||||
public virtual void OnLanguageChanged(AppLanguageModel languageModel)
|
||||
{
|
||||
var newCulture = new CultureInfo(languageModel.Code);
|
||||
|
||||
ApplicationLanguages.PrimaryLanguageOverride = languageModel.Code;
|
||||
|
||||
CultureInfo.DefaultThreadCurrentCulture = newCulture;
|
||||
CultureInfo.DefaultThreadCurrentUICulture = newCulture;
|
||||
}
|
||||
|
||||
public void Receive(LanguageChanged message) => OnLanguageChanged(TranslationService.CurrentLanguageModel);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Platforms>x86;x64;arm64</Platforms>
|
||||
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
|
||||
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Microsoft.UI.Xaml.Media"
|
||||
xmlns:xaml="using:Windows.UI.Xaml">
|
||||
xmlns:xaml="using:Microsoft.UI.Xaml">
|
||||
|
||||
<x:String x:Key="ThemeName">Acrylic</x:String>
|
||||
<x:Boolean x:Key="UseMica">False</x:Boolean>
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
<local:AcrylicBrush
|
||||
x:Key="WinoApplicationBackgroundColor"
|
||||
BackgroundSource="HostBackdrop"
|
||||
FallbackColor="#F9F9F9"
|
||||
TintColor="#FCFCFC"
|
||||
TintOpacity="0.75" />
|
||||
@@ -28,7 +27,6 @@
|
||||
|
||||
<local:AcrylicBrush
|
||||
x:Key="WinoApplicationBackgroundColor"
|
||||
BackgroundSource="HostBackdrop"
|
||||
FallbackColor="#2C2C2C"
|
||||
TintColor="#2C2C2C"
|
||||
TintOpacity="0.30" />
|
||||
@@ -1,7 +1,7 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:xaml="using:Windows.UI.Xaml">
|
||||
xmlns:xaml="using:Microsoft.UI.Xaml">
|
||||
|
||||
<x:String x:Key="ThemeName">Clouds</x:String>
|
||||
<x:String x:Key="ThemeBackgroundImage">ms-appx:///Wino.Core.UWP/BackgroundImages/Clouds.jpg</x:String>
|
||||
@@ -1,7 +1,7 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:xaml="using:Windows.UI.Xaml">
|
||||
xmlns:xaml="using:Microsoft.UI.Xaml">
|
||||
|
||||
<x:String x:Key="ThemeName">Custom</x:String>
|
||||
<x:String x:Key="ThemeBackgroundImage">ms-appdata:///local/CustomWallpaper.jpg</x:String>
|
||||
@@ -1,7 +1,7 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:xaml="using:Windows.UI.Xaml">
|
||||
xmlns:xaml="using:Microsoft.UI.Xaml">
|
||||
|
||||
<x:String x:Key="ThemeName">Forest</x:String>
|
||||
<x:String x:Key="ThemeBackgroundImage">ms-appx:///Wino.Core.UWP/BackgroundImages/Forest.jpg</x:String>
|
||||
@@ -1,7 +1,7 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:xaml="using:Windows.UI.Xaml">
|
||||
xmlns:xaml="using:Microsoft.UI.Xaml">
|
||||
|
||||
<x:String x:Key="ThemeName">Garden</x:String>
|
||||
<x:String x:Key="ThemeBackgroundImage">ms-appx:///Wino.Core.UWP/BackgroundImages/Garden.jpg</x:String>
|
||||
@@ -1,7 +1,7 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:xaml="using:Windows.UI.Xaml">
|
||||
xmlns:xaml="using:Microsoft.UI.Xaml">
|
||||
|
||||
<x:String x:Key="ThemeName">Mica</x:String>
|
||||
<x:Boolean x:Key="UseMica">True</x:Boolean>
|
||||
@@ -1,7 +1,7 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:xaml="using:Windows.UI.Xaml">
|
||||
xmlns:xaml="using:Microsoft.UI.Xaml">
|
||||
|
||||
<x:String x:Key="ThemeName">Nighty</x:String>
|
||||
<x:String x:Key="ThemeBackgroundImage">ms-appx:///Wino.Core.UWP/BackgroundImages/Nighty.jpg</x:String>
|
||||
@@ -1,7 +1,7 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:xaml="using:Windows.UI.Xaml">
|
||||
xmlns:xaml="using:Microsoft.UI.Xaml">
|
||||
|
||||
<x:String x:Key="ThemeName">Snowflake</x:String>
|
||||
<x:String x:Key="ThemeBackgroundImage">ms-appx:///Wino.Core.UWP/BackgroundImages/Snowflake.jpg</x:String>
|
||||
|
Before Width: | Height: | Size: 348 B After Width: | Height: | Size: 348 B |
|
Before Width: | Height: | Size: 504 B After Width: | Height: | Size: 504 B |
|
Before Width: | Height: | Size: 678 B After Width: | Height: | Size: 678 B |
|
Before Width: | Height: | Size: 591 B After Width: | Height: | Size: 591 B |
|
Before Width: | Height: | Size: 599 B After Width: | Height: | Size: 599 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 256 B After Width: | Height: | Size: 256 B |
|
Before Width: | Height: | Size: 712 B After Width: | Height: | Size: 712 B |
|
Before Width: | Height: | Size: 621 B After Width: | Height: | Size: 621 B |
|
Before Width: | Height: | Size: 413 B After Width: | Height: | Size: 413 B |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 962 KiB After Width: | Height: | Size: 962 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
@@ -3,9 +3,9 @@ using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Wino.Core.ViewModels;
|
||||
using Wino.Messaging.Client.Shell;
|
||||
|
||||
@@ -35,7 +35,7 @@ public abstract class BasePage<T> : BasePage where T : CoreBaseViewModel
|
||||
|
||||
protected BasePage()
|
||||
{
|
||||
ViewModel.Dispatcher = new UWPDispatcher(Dispatcher);
|
||||
ViewModel.Dispatcher = new WinUIDispatcher(DispatcherQueue);
|
||||
|
||||
Loaded += PageLoaded;
|
||||
Unloaded += PageUnloaded;
|
||||
@@ -2,8 +2,8 @@
|
||||
using System.Threading.Tasks;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Messaging.UI;
|
||||
@@ -48,21 +48,21 @@ public sealed partial class AccountCreationDialogControl : UserControl, IRecipie
|
||||
|
||||
await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
|
||||
{
|
||||
AuthHelpDialogButton.Visibility = Windows.UI.Xaml.Visibility.Visible;
|
||||
AuthHelpDialogButton.Visibility = Microsoft.UI.Xaml.Visibility.Visible;
|
||||
});
|
||||
}
|
||||
|
||||
private void ControlLoaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
|
||||
private void ControlLoaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
WeakReferenceMessenger.Default.Register(this);
|
||||
}
|
||||
|
||||
private void ControlUnloaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
|
||||
private void ControlUnloaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
WeakReferenceMessenger.Default.UnregisterAll(this);
|
||||
}
|
||||
|
||||
private async void CopyClicked(object sender, Windows.UI.Xaml.RoutedEventArgs e)
|
||||
private async void CopyClicked(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(copyClipboardURL)) return;
|
||||
|
||||
@@ -71,5 +71,5 @@ public sealed partial class AccountCreationDialogControl : UserControl, IRecipie
|
||||
}
|
||||
|
||||
|
||||
private void CancelButtonClicked(object sender, Windows.UI.Xaml.RoutedEventArgs e) => CancelClicked?.Invoke(this, null);
|
||||
private void CancelButtonClicked(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) => CancelClicked?.Invoke(this, null);
|
||||
}
|
||||
@@ -3,8 +3,8 @@
|
||||
namespace Wino.Core.UWP.Controls
|
||||
{
|
||||
using Windows.Foundation;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace CustomControls
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using Windows.Foundation;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace Wino.Core.UWP.Controls;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Windows.Input;
|
||||
using Windows.Foundation;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Enums;
|
||||
|
||||
namespace Wino.Core.UWP.Controls;
|
||||
@@ -1,5 +1,5 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace Wino.Core.UWP.Controls;
|
||||
|
||||
@@ -116,7 +116,7 @@ public partial class WinoFontIcon : FontIcon
|
||||
|
||||
public WinoFontIcon()
|
||||
{
|
||||
FontFamily = new Windows.UI.Xaml.Media.FontFamily("ms-appx:///Wino.Core.UWP/Assets/WinoIcons.ttf#WinoIcons");
|
||||
FontFamily = new Microsoft.UI.Xaml.Media.FontFamily("/Wino.Core.WinUI/Assets/WinoIcons.ttf#WinoIcons");
|
||||
FontSize = 32;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Wino.Core.UWP.Controls;
|
||||
|
||||
namespace Wino.Controls;
|
||||
@@ -15,7 +15,7 @@ public partial class WinoFontIconSource : Microsoft.UI.Xaml.Controls.FontIconSou
|
||||
|
||||
public WinoFontIconSource()
|
||||
{
|
||||
FontFamily = new Windows.UI.Xaml.Media.FontFamily("ms-appx:///Assets/WinoIcons.ttf#WinoIcons");
|
||||
FontFamily = new Microsoft.UI.Xaml.Media.FontFamily("ms-appx:///Assets/WinoIcons.ttf#WinoIcons");
|
||||
FontSize = 32;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Numerics;
|
||||
using CommunityToolkit.WinUI.Animations;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Wino.Core.Domain.Enums;
|
||||
|
||||
namespace Wino.Core.UWP.Controls;
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Numerics;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Hosting;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Hosting;
|
||||
|
||||
namespace Wino.Core.UWP.Controls;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
|
||||
namespace Wino.Converters;
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Windows.UI;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Windows.UI.Xaml.Media;
|
||||
|
||||
namespace Wino.Core.UWP.Converters;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
|
||||
namespace Wino.Converters;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
|
||||
namespace Wino.Converters;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Microsoft.UI.Xaml;
|
||||
|
||||
namespace Wino.Core.UWP;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Windows.ApplicationModel.AppService;
|
||||
using Windows.UI.Xaml;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.UWP.Services;
|
||||
using Wino.Core.ViewModels;
|
||||
@@ -21,7 +21,6 @@ public static class CoreUWPContainerSetup
|
||||
services.AddSingleton<IUnderlyingThemeService, UnderlyingThemeService>();
|
||||
services.AddSingleton<INativeAppService, NativeAppService>();
|
||||
services.AddSingleton<IStoreManagementService, StoreManagementService>();
|
||||
services.AddSingleton<IBackgroundTaskService, BackgroundTaskService>();
|
||||
services.AddSingleton<IPreferencesService, PreferencesService>();
|
||||
services.AddSingleton<IThemeService, ThemeService>();
|
||||
services.AddSingleton<IStatePersistanceService, StatePersistenceService>();
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Entities.Shared;
|
||||
|
||||
namespace Wino.Dialogs;
|
||||
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using CommunityToolkit.WinUI.Helpers;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.UWP;
|
||||
|
||||
@@ -43,7 +43,7 @@ public sealed partial class CustomThemeBuilderDialog : ContentDialog
|
||||
}
|
||||
}
|
||||
|
||||
private async void BrowseWallpaperClicked(object sender, Windows.UI.Xaml.RoutedEventArgs e)
|
||||
private async void BrowseWallpaperClicked(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
|
||||
{
|
||||
var dialogService = WinoApplication.Current.Services.GetService<IMailDialogService>();
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Windows.System;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Models.Accounts;
|
||||
@@ -1,5 +1,5 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace Wino.Dialogs;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using CommunityToolkit.WinUI;
|
||||
using Microsoft.UI.Dispatching;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Core.UWP;
|
||||
|
||||
public class WinUIDispatcher : IDispatcher
|
||||
{
|
||||
private readonly DispatcherQueue _coreDispatcher;
|
||||
|
||||
public WinUIDispatcher(DispatcherQueue coreDispatcher)
|
||||
{
|
||||
_coreDispatcher = coreDispatcher;
|
||||
}
|
||||
|
||||
public Task ExecuteOnUIThread(Action action) => _coreDispatcher.EnqueueAsync(action, DispatcherQueuePriority.Normal);
|
||||
}
|
||||
@@ -5,8 +5,8 @@ using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Composition;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Media.Animation;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media.Animation;
|
||||
|
||||
namespace Wino.Extensions;
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Composition;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Hosting;
|
||||
using Microsoft.UI.Composition;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Hosting;
|
||||
|
||||
namespace Wino.Extensions;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Wino.Core.Domain.Enums;
|
||||
|
||||
namespace Wino.Core.UWP.Extensions;
|
||||
@@ -1,12 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.UI.Composition;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Hosting;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Windows.Foundation;
|
||||
using Windows.UI.Composition;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Hosting;
|
||||
using Windows.UI.Xaml.Media;
|
||||
|
||||
namespace Wino.Extensions;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
|
||||
namespace Wino.Helpers;
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using CommunityToolkit.WinUI.Helpers;
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Text;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Markup;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Windows.UI;
|
||||
using Windows.UI.Text;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Controls.Primitives;
|
||||
using Windows.UI.Xaml.Markup;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Wino.Core.Domain;
|
||||
using Wino.Core.Domain.Entities.Shared;
|
||||
using Wino.Core.Domain.Enums;
|
||||
@@ -295,7 +296,7 @@ public static class XamlHelpers
|
||||
"<Path " +
|
||||
"xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>" +
|
||||
"<Path.Data>" + pathMarkup + "</Path.Data></Path>";
|
||||
var path = XamlReader.Load(xaml) as Windows.UI.Xaml.Shapes.Path;
|
||||
var path = XamlReader.Load(xaml) as Microsoft.UI.Xaml.Shapes.Path;
|
||||
|
||||
Geometry geometry = path.Data;
|
||||
path.Data = null;
|
||||
@@ -0,0 +1,11 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace Wino.Core.WinUI.Interfaces;
|
||||
|
||||
public interface IWinoShellWindow
|
||||
{
|
||||
void HandleAppActivation(LaunchActivatedEventArgs args);
|
||||
Microsoft.UI.Xaml.Controls.TitleBar GetTitleBar();
|
||||
Frame GetMainFrame();
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.UWP.Models.Personalization;
|
||||
|
||||
namespace Wino.Core.UWP.Selectors;
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Enums;
|
||||
|
||||
namespace Wino.Core.UWP.Selectors;
|
||||
@@ -1,5 +1,5 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.Enums;
|
||||
|
||||
namespace Wino.Core.UWP.Selectors;
|
||||
@@ -1,5 +1,5 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain.MenuItems;
|
||||
|
||||
namespace Wino.Core.UWP.Selectors;
|
||||
@@ -1,5 +1,5 @@
|
||||
using System.Linq;
|
||||
using Windows.UI.Xaml;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.UWP;
|
||||
|
||||
@@ -7,8 +7,8 @@ using Serilog;
|
||||
using Windows.Storage;
|
||||
using Windows.Storage.AccessCache;
|
||||
using Windows.Storage.Pickers;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Wino.Core.Domain;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
@@ -1,6 +1,6 @@
|
||||
using Windows.System;
|
||||
using Windows.UI.Core;
|
||||
using Windows.UI.Xaml;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Core.UWP.Services;
|
||||