mirror of
https://github.com/AlexMacocian/WpfExtended.git
synced 2026-07-15 14:59:30 +00:00
Make ApplicationStarting asynchronous
This commit is contained in:
@@ -7,6 +7,7 @@ using System;
|
||||
using System.Extensions;
|
||||
using System.Logging;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Extensions;
|
||||
using WpfExtended.Test;
|
||||
using WpfExtended.Tests.Services;
|
||||
@@ -47,9 +48,7 @@ namespace WpfExtended.Tests
|
||||
{
|
||||
}
|
||||
|
||||
protected override void ApplicationStarting()
|
||||
{
|
||||
}
|
||||
protected override ValueTask ApplicationStarting() => ValueTask.CompletedTask;
|
||||
|
||||
protected override bool HandleException(Exception e)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace System.Windows.Extensions
|
||||
/// <summary>
|
||||
/// Called right before the window is shown.
|
||||
/// </summary>
|
||||
protected abstract void ApplicationStarting();
|
||||
protected abstract ValueTask ApplicationStarting();
|
||||
/// <summary>
|
||||
/// Called right before the application is closing.
|
||||
/// </summary>
|
||||
@@ -86,9 +86,9 @@ namespace System.Windows.Extensions
|
||||
this.ApplicationClosing();
|
||||
}
|
||||
|
||||
private void LaunchWindow()
|
||||
private async void LaunchWindow()
|
||||
{
|
||||
this.ApplicationStarting();
|
||||
await this.ApplicationStarting().ConfigureAwait(true);
|
||||
foreach(var service in this.ServiceProvider.GetServices<IApplicationLifetimeService>())
|
||||
{
|
||||
service.OnStartup();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||
<PackageLicenseFile>License.txt</PackageLicenseFile>
|
||||
<Version>0.7.8</Version>
|
||||
<Version>0.7.9</Version>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Description>Extension library for Windows Presentation Platform.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user