Compare commits
No commits in common. "5b6d2e82db980307b82a98f9da9ab8e8fed5d9dc" and "4a68494162b3a38e1609f86b69668175c1908915" have entirely different histories.
5b6d2e82db
...
4a68494162
4 changed files with 32 additions and 43 deletions
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
|
@ -6,7 +6,6 @@
|
||||||
"asciidoctor",
|
"asciidoctor",
|
||||||
"ASPNETCORE",
|
"ASPNETCORE",
|
||||||
"Avalonia",
|
"Avalonia",
|
||||||
"blogspot",
|
|
||||||
"Configurabilité",
|
"Configurabilité",
|
||||||
"Cratie",
|
"Cratie",
|
||||||
"DESTDIR",
|
"DESTDIR",
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ Cette convention est partagée avec le dépôt
|
||||||
pour la production des paquets `.deb`.
|
pour la production des paquets `.deb`.
|
||||||
|
|
||||||
|
|
||||||
## [1.0.8-rc6] - unstable
|
## [1.0.8-rc5] - unstable
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
|
|
@ -16,8 +15,6 @@ namespace PostIt;
|
||||||
|
|
||||||
public partial class App : Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
private int _bootStarted;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// DI container the platform entry points hand to ViewModels so
|
/// DI container the platform entry points hand to ViewModels so
|
||||||
/// they can resolve the canonical <see cref="Settings"/> singleton
|
/// they can resolve the canonical <see cref="Settings"/> singleton
|
||||||
|
|
@ -48,6 +45,8 @@ public partial class App : Application
|
||||||
{
|
{
|
||||||
var window = ServiceProvider.GetRequiredService<MainWindow>();
|
var window = ServiceProvider.GetRequiredService<MainWindow>();
|
||||||
desktop.MainWindow = window;
|
desktop.MainWindow = window;
|
||||||
|
var api = ServiceProvider!.GetRequiredService<YavscApiClient>();
|
||||||
|
desktop.MainWindow.Opened += async (_, _) => await BootAsync(this.ServiceProvider!, api);
|
||||||
View = window.MainView;
|
View = window.MainView;
|
||||||
this.ConfigureRootView(window.MainView);
|
this.ConfigureRootView(window.MainView);
|
||||||
|
|
||||||
|
|
@ -76,8 +75,10 @@ public partial class App : Application
|
||||||
|
|
||||||
private void ConfigureRootView(MainView rootView)
|
private void ConfigureRootView(MainView rootView)
|
||||||
{
|
{
|
||||||
// Déclencher le Boot une seule fois lors du chargement du contrôle à l'écran.
|
var api = ServiceProvider!.GetRequiredService<YavscApiClient>();
|
||||||
rootView.AttachedToVisualTree += async (_, _) => await BootOnceAsync();
|
|
||||||
|
// Déclencher le Boot lors du chargement du contrôle à l'écran
|
||||||
|
rootView.AttachedToVisualTree += async (_, _) => await BootAsync(this.ServiceProvider!, api);
|
||||||
|
|
||||||
var sessionStatus = ServiceProvider!.GetRequiredService<SessionStatusViewModel>();
|
var sessionStatus = ServiceProvider!.GetRequiredService<SessionStatusViewModel>();
|
||||||
sessionStatus.LogoutCompleted += () =>
|
sessionStatus.LogoutCompleted += () =>
|
||||||
|
|
@ -94,17 +95,6 @@ private void ConfigureRootView(MainView rootView)
|
||||||
rootView.SessionBanner.DataContext = sessionStatus;
|
rootView.SessionBanner.DataContext = sessionStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task BootOnceAsync()
|
|
||||||
{
|
|
||||||
if (Interlocked.Exchange(ref _bootStarted, 1) == 1)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var api = ServiceProvider!.GetRequiredService<YavscApiClient>();
|
|
||||||
await BootAsync(this.ServiceProvider!, api);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Test-only hook: bind a concrete <see cref="MainView"/> so
|
/// Test-only hook: bind a concrete <see cref="MainView"/> so
|
||||||
/// command-driven navigation paths (<see cref="PushPage"/>) can
|
/// command-driven navigation paths (<see cref="PushPage"/>) can
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ namespace Yavsc.Api.Client;
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class BlogApiClient
|
public sealed class BlogApiClient
|
||||||
{
|
{
|
||||||
private const string DefaultPathPrefix = "blogspot";
|
private const string DefaultPathPrefix = "blog";
|
||||||
|
|
||||||
private readonly IYavscApiClient _api;
|
private readonly IYavscApiClient _api;
|
||||||
private readonly Uri _baseAddress;
|
private readonly Uri _baseAddress;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue