Initial implementation of label edit page.
ADD
WalletWasabi.Fluent/ViewModels/Wallets/Receive/AddressLabelEditViewModel.cs
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Reactive.Linq;
+using ReactiveUI;
+using WalletWasabi.Blockchain.Analysis.Clustering;
+using WalletWasabi.Fluent.ViewModels.Navigation;
+using WalletWasabi.Wallets;
+
+namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
+{
+ [NavigationMetaData(Title = "Edit Labels")]
+ public partial class AddressLabelEditViewModel : RoutableViewModel
+ {
+ [AutoNotify] private string _label;
+ [AutoNotify] private AddressViewModel _targetAddress;
+ [AutoNotify] private ObservableCollection<string> _labels;
+
+ public AddressLabelEditViewModel(AddressViewModel addressViewModel)
+ {
+ _targetAddress = addressViewModel;
+ _labels = new();
+
+ foreach (var labelString in _targetAddress.Labels)
+ {
+ _labels.Add(labelString);
+ }
+
+ NextCommand = ReactiveCommand.CreateFromTask(async () =>
+ {
+ _targetAddress.Labels = Labels;
+ Navigate().Back();
+ });
+ }
+ }
+}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveAddressesViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Receive/ReceiveAddressesViewModel.cs
@@ -5,6 +5,7 @@ using System.Linq;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Threading.Tasks;
+using System.Windows.Input;
using Avalonia;
using NBitcoin;
using ReactiveUI;
@@ -69,7 +70,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
foreach (HdPubKey key in keys)
{
- Addresses.Add(new AddressViewModel(key, Network, HideAddress));
+ Addresses.Add(new AddressViewModel(this, key, Network, HideAddress));
}
}
catch (Exception ex)
@@ -96,5 +97,10 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Receive
await Application.Current.Clipboard.ClearAsync();
}
}
+
+ public async Task NavigateToAddressEdit(AddressViewModel address)
+ {
+ Navigate().To(new AddressLabelEditViewModel(address));
+ }
}
}

ADD
WalletWasabi.Fluent/Views/Wallets/Receive/AddressLabelEditView.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:receive="clr-namespace:WalletWasabi.Fluent.ViewModels.Wallets.Receive"
+ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
+ x:DataType="receive:AddressLabelEditViewModel"
+ x:CompileBindings="True"
+ x:Class="WalletWasabi.Fluent.Views.Wallets.Receive.AddressLabelEditView">
+ <c:ContentArea Title="{Binding Title}"
+ EnableBack="True"
+ EnableCancel="True"
+ EnableNext="True"
+ NextContent="Save">
+ <Panel>
+ <c:TagsBox x:Name="LabelTagBox"
+ TagSeparator=","
+ Items="{Binding Labels}"
+ Suggestions="{Binding Labels}"
+ SuggestionsAreCaseSensitive="True"
+ RestrictInputToSuggestions="False" />
+ </Panel>
+ </c:ContentArea>
+</UserControl>

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

MODIFY
WalletWasabi.Fluent/Views/Wallets/Receive/ReceiveAddressesView.axaml
WalletWasabi.Fluent/Views/Wallets/Receive/ReceiveAddressesView.axaml
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<DockPanel LastChildFill="True" Margin="10 0" x:DataType="receive:AddressViewModel">
- <Button Classes="plain addressActionButton" ToolTip.Tip="Edit">
+ <Button Classes="plain addressActionButton" ToolTip.Tip="Edit" Command="{Binding EditLabelCommand}">
<PathIcon Data="{StaticResource wallet_action_coinjoin}" Classes="addressActionIcon" />
</Button>
<TextBlock Text="{Binding Label}"/>

MODIFY
WalletWasabi.Fluent/WalletWasabi.Fluent.csproj
WalletWasabi.Fluent/WalletWasabi.Fluent.csproj
<ItemGroup>
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
</ItemGroup>
+
+ <ItemGroup>
+ <Compile Update="Views\Wallets\Receive\AddressLabelEditView.axaml.cs">
+ <DependentUpon>AddressLabelEditView.axaml</DependentUpon>
+ <SubType>Code</SubType>
+ </Compile>
+ </ItemGroup>
</Project>

Initial implementation of label edit page.