checkmarks animations
MODIFY
WalletWasabi.Fluent/AddWallet/CreateWallet/ConfirmRecoveryWordsView.axaml
WalletWasabi.Fluent/AddWallet/CreateWallet/ConfirmRecoveryWordsView.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
xmlns:behaviors="clr-namespace:WalletWasabi.Fluent.Behaviors;assembly=WalletWasabi.Fluent"
+ xmlns:converters="clr-namespace:WalletWasabi.Fluent.Converters;assembly=WalletWasabi.Fluent"
xmlns:c="clr-namespace:WalletWasabi.Fluent.Controls"
mc:Ignorable="d"
d:DesignWidth="600" d:DesignHeight="500"
x:Class="WalletWasabi.Fluent.AddWallet.CreateWallet.ConfirmRecoveryWordsView">
+ <UserControl.Resources>
+ <converters:BoolToOpacityConverter x:Key="BoolToOpacityConverter" />
+ </UserControl.Resources>
<Panel>
<c:ContentArea Title="Confirm recovery words" Caption="Type the required recovery words">
<behaviors:FocusNextItemBehavior IsFocused="{Binding !IsConfirmed}" />
</i:Interaction.Behaviors>
</TextBox>
- <PathIcon Classes="checkMark" Margin="15 10 0 0" VerticalAlignment="Top" IsVisible="{Binding IsConfirmed}" />
+ <PathIcon Classes="checkMark" Margin="15 10 0 0" VerticalAlignment="Top" Opacity="{Binding IsConfirmed, Converter={StaticResource BoolToOpacityConverter}}" />
</StackPanel>
</StackPanel>
</DataTemplate>

MODIFY
WalletWasabi.Fluent/Behaviors/CheckMarkVisibilityBehavior.cs
WalletWasabi.Fluent/Behaviors/CheckMarkVisibilityBehavior.cs
using Avalonia;
using Avalonia.Controls;
-using Avalonia.Input;
-using Avalonia.Xaml.Interactivity;
using ReactiveUI;
using System;
-using System.Collections.Generic;
-using System.Reactive.Disposables;
using System.Reactive.Linq;
-using System.Text;
namespace WalletWasabi.Fluent.Behaviors
{
@@ -55,7 +50,9 @@ namespace WalletWasabi.Fluent.Behaviors
x => x.HasErrors,
x => x.IsFocused,
x => x.Text)
- .Subscribe(_ => AssociatedObject!.IsVisible = !HasErrors && !IsFocused && !string.IsNullOrEmpty(Text));
+ .Throttle(TimeSpan.FromMilliseconds(100))
+ .ObserveOn(RxApp.MainThreadScheduler)
+ .Subscribe(_ => AssociatedObject!.Opacity = !HasErrors && !IsFocused && !string.IsNullOrEmpty(Text) ? 1 : 0);
Observable
.FromEventPattern<AvaloniaPropertyChangedEventArgs>(OwnerTextBox, nameof(OwnerTextBox.PropertyChanged))

ADD
WalletWasabi.Fluent/Converters/BoolToOpacityConverter.cs
+using Avalonia.Data.Converters;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Text;
+
+namespace WalletWasabi.Fluent.Converters
+{
+ public class BoolToOpacityConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return (bool)value ? 1.0 : 0.0;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}

MODIFY
WalletWasabi.Fluent/Styles/Styles.xaml
WalletWasabi.Fluent/Styles/Styles.xaml
<Setter Property="Width" Value="15" />
<Setter Property="Height" Value="15" />
<Setter Property="Data" Value="{StaticResource checkmark_filled}" />
+ <Setter Property="Opacity" Value="0" />
<Setter Property="Transitions">
<Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.3"/>
</Setter>
</Style>
- <Style Selector="PathIcon[IsVisible=true]">
- <Setter Property="Opacity" Value="1" />
- </Style>
-
- <Style Selector="PathIcon[IsVisible=false]">
- <Setter Property="Opacity" Value="0" />
- </Style>
-
<Style Selector="DataValidationErrors">
<Setter Property="Template">
<ControlTemplate>

checkmarks animations