add dialog for label entry
ADD
WalletWasabi.Fluent/ViewModels/Dialogs/LabelEntryDialogViewModel.cs
+using System;
+using System.Linq;
+using System.Reactive;
+using System.Reactive.Disposables;
+using System.Reactive.Linq;
+using DynamicData;
+using ReactiveUI;
+using WalletWasabi.Blockchain.Analysis.Clustering;
+using WalletWasabi.Fluent.ViewModels.Dialogs.Base;
+using WalletWasabi.Fluent.ViewModels.Wallets.Labels;
+using WalletWasabi.Fluent.ViewModels.Wallets.Send;
+using WalletWasabi.Wallets;
+
+namespace WalletWasabi.Fluent.ViewModels.Dialogs
+{
+ [NavigationMetaData(Title = "Recipient")]
+ public partial class LabelEntryDialogViewModel : DialogViewModelBase<SmartLabel?>
+ {
+ private readonly Wallet _wallet;
+
+ public LabelEntryDialogViewModel(Wallet wallet, TransactionInfo info)
+ {
+ _wallet = wallet;
+ SuggestionLabels = new SuggestionLabelsViewModel(3)
+ {
+ Labels = { info.UserLabels.Labels }
+ };
+
+ SetupCancel(enableCancel: true, enableCancelOnEscape: true, enableCancelOnPressed: true);
+
+ var nextCommandCanExecute =
+ Observable
+ .Merge(SuggestionLabels.WhenAnyValue(x => x.Labels.Count).Select(_ => Unit.Default))
+ .Merge(SuggestionLabels.WhenAnyValue(x => x.IsCurrentTextValid).Select(_ => Unit.Default))
+ .Select(_ => SuggestionLabels.Labels.Any() || SuggestionLabels.IsCurrentTextValid);
+
+ NextCommand = ReactiveCommand.Create(OnNext, nextCommandCanExecute);
+ }
+
+ public SuggestionLabelsViewModel SuggestionLabels { get; }
+
+ private void OnNext()
+ {
+ Close(DialogResultKind.Normal, new SmartLabel(SuggestionLabels.Labels.ToArray()));
+ }
+
+ protected override void OnNavigatedTo(bool isInHistory, CompositeDisposable disposables)
+ {
+ base.OnNavigatedTo(isInHistory, disposables);
+
+ _wallet.TransactionProcessor.WhenAnyValue(x => x.Coins)
+ .Select(_ => Unit.Default)
+ .ObserveOn(RxApp.MainThreadScheduler)
+ .Subscribe(_ => SuggestionLabels.UpdateLabels())
+ .DisposeWith(disposables);
+ }
+ }
+}

ADD
WalletWasabi.Fluent/Views/Dialogs/LabelEntryDialogView.axaml
+<UserControl xmlns="https://github.com/avaloniaui"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:c="using:WalletWasabi.Fluent.Controls"
+ xmlns:behaviors="using:WalletWasabi.Fluent.Behaviors"
+ xmlns:i="using:Avalonia.Xaml.Interactivity"
+ xmlns:dialogs="clr-namespace:WalletWasabi.Fluent.ViewModels.Dialogs"
+ mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="270"
+ x:DataType="dialogs:LabelEntryDialogViewModel"
+ x:CompileBindings="True"
+ x:Class="WalletWasabi.Fluent.Views.Dialogs.LabelEntryDialogView">
+ <c:ContentArea Width="500" Height="300"
+ Title="{Binding Title}"
+ Caption="Enter the name or the company who will you send to"
+ CancelContent="Cancel"
+ EnableCancel="{Binding EnableCancel}"
+ EnableBack="{Binding EnableBack}"
+ EnableNext="True" NextContent="Done">
+ <c:TagsBox x:Name="LabelTagBox"
+ DataContext="{Binding SuggestionLabels}"
+ VerticalAlignment="Top"
+ Watermark="{StaticResource LabelsWatermarkText}"
+ TagSeparator=","
+ SuggestionsAreCaseSensitive="True"
+ RestrictInputToSuggestions="False"
+ Items="{Binding Labels}"
+ TopItems="{Binding TopSuggestions}"
+ Suggestions="{Binding Suggestions}"
+ MaxTextLength="{StaticResource MaxLabelLength}"
+ IsCurrentTextValid="{Binding IsCurrentTextValid, Mode=OneWayToSource}">
+ <i:Interaction.Behaviors>
+ <behaviors:FocusOnAttachedBehavior />
+ </i:Interaction.Behaviors>
+ </c:TagsBox>
+ </c:ContentArea>
+</UserControl>

ADD
WalletWasabi.Fluent/Views/Dialogs/LabelEntryDialogView.axaml.cs
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace WalletWasabi.Fluent.Views.Dialogs
+{
+ public class LabelEntryDialogView : UserControl
+ {
+ public LabelEntryDialogView()
+ {
+ InitializeComponent();
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+ }
+}

add dialog for label entry