Skip to content

Commit

Permalink
chore: updating loadable
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Oct 10, 2023
1 parent 363f90b commit 22ab59f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
3 changes: 2 additions & 1 deletion src/Uno/Prism.Uno/PrismApplicationBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ void FinalizeInitialization()
_host = builder.Build();
InitializeModules();
OnInitialized();
loadable.IsExecuting = false;
loadable.FinishLoading();
MvvmHelpers.ViewAndViewModelAction<IActiveAware>(shell, x => x.IsActive = true);
}

if (shell is FrameworkElement fe)
Expand Down
28 changes: 14 additions & 14 deletions src/Uno/Prism.Uno/PrismShellLoadable.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
using Uno.Toolkit;

namespace Prism;
namespace Prism;

#nullable enable
internal sealed class PrismShellLoadable : ILoadable
internal sealed class PrismShellLoadable : Uno.ILoadable, Uno.Toolkit.ILoadable
{
private bool _isExecuting = true;
public bool IsExecuting
{
get => _isExecuting;
set
{
_isExecuting = value;
IsExecutingChanged?.Invoke(this, EventArgs.Empty);
}
}
public bool IsExecuting { get; private set; } = true;

public bool IsLoaded { get; private set; }

public event EventHandler? IsExecutingChanged;
public event EventHandler<EventArgs>? Loaded;

public void FinishLoading()
{
IsExecuting = false;
IsLoaded = true;
IsExecutingChanged?.Invoke(this, EventArgs.Empty);
Loaded?.Invoke(this, EventArgs.Empty);
}
}

0 comments on commit 22ab59f

Please sign in to comment.