trigger load screen when window is on screen.
ADD
WalletWasabi.Fluent/Behaviors/TopLevelLoadedBehavior.cs
+using System;
+using System.Reactive.Disposables;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Data;
+using Avalonia.VisualTree;
+
+namespace WalletWasabi.Fluent.Behaviors
+{
+ public class TopLevelLoadedBehavior : AttachedToVisualTreeBehavior<Visual>
+ {
+ private IDisposable? _disposable;
+ public static readonly StyledProperty<bool> IsLoadedProperty =
+ AvaloniaProperty.Register<TopLevelLoadedBehavior, bool>(nameof(IsLoaded), defaultBindingMode: BindingMode.TwoWay);
+
+ public bool IsLoaded
+ {
+ get => GetValue(IsLoadedProperty);
+ set => SetValue(IsLoadedProperty, value);
+ }
+
+ private void TopLevelOnOpened(object? sender, EventArgs e)
+ {
+ IsLoaded = true;
+ }
+
+ protected override void OnAttachedToVisualTree()
+ {
+ if (AssociatedObject.GetVisualRoot() is TopLevel topLevel)
+ {
+ topLevel.Opened += TopLevelOnOpened;
+
+ _disposable = Disposable.Create(() => { topLevel.Opened -= TopLevelOnOpened; });
+ }
+ }
+
+ protected override void OnDetaching()
+ {
+ base.OnDetaching();
+ _disposable?.Dispose();
+ }
+ }
+}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
@@ -35,6 +35,7 @@ namespace WalletWasabi.Fluent.ViewModels
[AutoNotify] private StatusBarViewModel _statusBar;
[AutoNotify] private string _title = "Wasabi Wallet";
[AutoNotify] private WindowState _windowState;
+ [AutoNotify] private bool _isLoaded;
public MainViewModel()
{

MODIFY
WalletWasabi.Fluent/Views/MainView.axaml
WalletWasabi.Fluent/Views/MainView.axaml
x:DataType="vm:MainViewModel"
x:CompileBindings="True"
x:Class="WalletWasabi.Fluent.Views.MainView">
+ <i:Interaction.Behaviors>
+ <behaviors:TopLevelLoadedBehavior IsLoaded="{Binding IsLoaded}" />
+ </i:Interaction.Behaviors>
<Panel>
<SplitView
IsEnabled="{Binding IsMainContentEnabled}"
</Style.Animations>
</Style>
</Panel.Styles>
- <Lottie Speed="0.2" Stretch="UniformToFill" StretchDirection="Both" RepeatCount="0" Source="avares://WalletWasabi.Fluent/Assets/loadscreen.json" />
+ <Lottie IsEnabled="{Binding IsLoaded}" Speed="0.35" Stretch="UniformToFill" StretchDirection="Both" RepeatCount="0" Source="avares://WalletWasabi.Fluent/Assets/loadscreen1.json" />
</Panel>
</Panel>
</UserControl>

trigger load screen when window is on screen.