Skip to content

Commit

Permalink
Another approach WalletWasabi#2
Browse files Browse the repository at this point in the history
  • Loading branch information
kiminuo committed Jun 23, 2023
1 parent aef57ae commit b87ef26
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions WalletWasabi.Fluent.Desktop/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
using Avalonia.Controls;
using System.Reactive.Linq;
using WalletWasabi.Fluent.Views;
using Avalonia.Platform;
using System.Threading;

namespace WalletWasabi.Fluent.Desktop;

Expand Down Expand Up @@ -211,23 +213,20 @@ public static async Task<ExitCode> RunAsGuiAsync(this WasabiApplication app)
ThemeHelper.ApplyTheme(uiConfig.DarkModeEnabled ? Theme.Dark : Theme.Light);
});
appBuilder.Start(AppMain, app.AppConfig.Arguments);
// appBuilder.StartWithClassicDesktopLifetime(app.AppConfig.Arguments);
ClassicDesktopStyleApplicationLifetime lifetime = new()
{
Args = app.AppConfig.Arguments,
ShutdownMode = ShutdownMode.OnLastWindowClose
};
return Task.CompletedTask;
});
}
appBuilder.SetupWithLifetime(lifetime);
//int exitCode = lifetime.Start(app.AppConfig.Arguments);
/// <summary>
/// Application entry point. Avalonia is completely initialized.
/// </summary>
/// <seealso href="https://docs.avaloniaui.net/docs/getting-started/application-lifetimes"/>
static void AppMain(Application app, string[] args)
{
// Do you startup code here.
new MainWindow().Show();
appBuilder.Instance.Run(Services.TerminateService.CancellationToken);
// Start the main loop.
app.Run(Services.TerminateService.CancellationToken);
return Task.CompletedTask;
});
}

private static UiConfig LoadOrCreateUiConfig(string dataDir)
Expand Down

0 comments on commit b87ef26

Please sign in to comment.