Cannot copy when text is null
MODIFY
WalletWasabi.Fluent/Controls/ClipboardCopyButton.axaml.cs
WalletWasabi.Fluent/Controls/ClipboardCopyButton.axaml.cs
@@ -47,7 +47,8 @@ public class ClipboardCopyButton : TemplatedControl
public ClipboardCopyButton()
{
- CopyCommand = ReactiveCommand.CreateFromTask(CopyToClipboard);
+ CopyCommand = ReactiveCommand.CreateFromTask(CopyToClipboard,
+ this.WhenAnyValue(c => c.Text, selector: s => s is not null));
var obs = CopyCommand.Select(unit => true)
.Merge(CopyCommand.Delay(TimeSpan.FromSeconds(2)).Select(_ => false));

MODIFY
WalletWasabi.Fluent/Controls/PreviewItem.axaml
WalletWasabi.Fluent/Controls/PreviewItem.axaml
xmlns:c="using:WalletWasabi.Fluent.Controls">
<Design.PreviewWith>
- <c:PreviewItem Text="Text to preview"></c:PreviewItem>
+ <c:PreviewItem Label="Text to preview"></c:PreviewItem>
</Design.PreviewWith>
<Style Selector="c|PreviewItem">
Foreground="{StaticResource SystemAccentNeutralColor}"
IsVisible="{TemplateBinding IsIconVisible}" DockPanel.Dock="Left" />
<DockPanel DockPanel.Dock="Right" Margin="30 0 0 0">
- <TextBlock Name="PART_Text" Text="{TemplateBinding Text}" DockPanel.Dock="Top" Margin="0 0 0 5" Opacity="0.6" />
+ <TextBlock Name="PART_Text" Text="{TemplateBinding Label}" DockPanel.Dock="Top" Margin="0 0 0 5" Opacity="0.6" />
<DockPanel HorizontalAlignment="Left" DockPanel.Dock="Bottom">
- <c:ClipboardCopyButton DockPanel.Dock="Right" Width="30" Text="{TemplateBinding Text}" IsVisible="{TemplateBinding CopyButtonVisibility}" />
+ <c:ClipboardCopyButton ToolTip.Tip="Copy" ToolTip.Placement="Bottom" DockPanel.Dock="Right" Width="30" Text="{TemplateBinding Value}" IsVisible="{TemplateBinding CopyButtonVisibility}" />
<Panel>
<ContentPresenter Name="PART_ContentPresenter" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"

MODIFY
WalletWasabi.Fluent/Controls/PreviewItem.axaml.cs
WalletWasabi.Fluent/Controls/PreviewItem.axaml.cs
@@ -8,8 +8,8 @@ namespace WalletWasabi.Fluent.Controls;
public class PreviewItem : ContentControl
{
- public static readonly StyledProperty<string> TextProperty =
- AvaloniaProperty.Register<PreviewItem, string>(nameof(Text));
+ public static readonly StyledProperty<string> LabelProperty =
+ AvaloniaProperty.Register<PreviewItem, string>(nameof(Label));
public static readonly StyledProperty<Geometry> IconProperty =
AvaloniaProperty.Register<PreviewItem, Geometry>(nameof(Icon));
@@ -20,8 +20,8 @@ public class PreviewItem : ContentControl
public static readonly StyledProperty<bool> IsIconVisibleProperty =
AvaloniaProperty.Register<PreviewItem, bool>(nameof(IsIconVisible));
- public static readonly StyledProperty<object?> CopyParameterProperty =
- AvaloniaProperty.Register<PreviewItem, object?>(nameof(CopyParameter));
+ public static readonly StyledProperty<string> ValueProperty =
+ AvaloniaProperty.Register<PreviewItem, string>(nameof(Value));
public static readonly StyledProperty<ICommand> CopyCommandProperty =
AvaloniaProperty.Register<PreviewItem, ICommand>(nameof(CopyCommand));
@@ -37,10 +37,10 @@ public class PreviewItem : ContentControl
this.Bind(CopyButtonVisibilityProperty, this.WhenAnyValue(item => item.IsPointerOver));
}
- public string Text
+ public string Label
{
- get => GetValue(TextProperty);
- set => SetValue(TextProperty, value);
+ get => GetValue(LabelProperty);
+ set => SetValue(LabelProperty, value);
}
public Geometry Icon
@@ -61,10 +61,10 @@ public class PreviewItem : ContentControl
set => SetValue(IsIconVisibleProperty, value);
}
- public object? CopyParameter
+ public string Value
{
- get => GetValue(CopyParameterProperty);
- set => SetValue(CopyParameterProperty, value);
+ get => GetValue(ValueProperty);
+ set => SetValue(ValueProperty, value);
}
public ICommand CopyCommand

MODIFY
WalletWasabi.Fluent/Views/TransactionBroadcasting/BroadcastTransactionView.axaml
WalletWasabi.Fluent/Views/TransactionBroadcasting/BroadcastTransactionView.axaml
IsBusy="{Binding IsBusy}">
<StackPanel Spacing="20">
<c:PreviewItem Icon="{StaticResource transaction_id}"
- Text="Transaction ID"
+ Label="Transaction ID"
Content="{Binding TransactionId, FallbackValue=ab550cbedcacc9e4d1d6d37b1dc54eee0cax7b70c4e0beeac2d0915353b70ae0}" />
<Separator />
<c:PreviewItem Icon="{StaticResource btc_logo}"
- Text="Input amount"
+ Label="Input amount"
Content="{Binding InputAmountString, FallbackValue=0.0001 1234 BTC}" />
<Separator />
<c:PreviewItem Icon="{StaticResource btc_logo}"
- Text="Output amount"
+ Label="Output amount"
Content="{Binding OutputAmountString, FallbackValue=0.0001 1234 BTC}" />
<Separator />
<c:PreviewItem Icon="{StaticResource arrow_down_right_circle_regular}"
- Text="Input count"
+ Label="Input count"
Content="{Binding InputCount, FallbackValue=1}" />
<Separator />
<c:PreviewItem Icon="{StaticResource arrow_up_right_circle_regular}"
- Text="Output count"
+ Label="Output count"
Content="{Binding OutputCount, FallbackValue=1}" />
<Separator />
<c:PreviewItem Icon="{StaticResource paper_cash_regular}"
- Text="Fee"
+ Label="Fee"
Content="{Binding FeeString, FallbackValue=0.0001 1234 BTC}" />
</StackPanel>
</c:ContentArea>

MODIFY
WalletWasabi.Fluent/Views/Wallets/Advanced/WalletInfoView.axaml
WalletWasabi.Fluent/Views/Wallets/Advanced/WalletInfoView.axaml
<StackPanel Spacing="10" Margin="0 0 20 0">
<c:PreviewItem Icon="{StaticResource private_key_regular}"
- Text="Extended Master Private Key"
- CopyParameter="{Binding ExtendedMasterPrivateKey}"
+ Label="Extended Master Private Key"
+ Value="{Binding ExtendedMasterPrivateKey}"
IsVisible="{Binding !!ExtendedMasterPrivateKey}"
PrivacyModeEnabled="{Binding !ShowSensitiveData}" >
<TextBlock Classes="monoSpaced" Text="{Binding ExtendedMasterPrivateKey}" />
<Separator IsVisible="{Binding !!ExtendedMasterPrivateKey}" />
<c:PreviewItem Icon="{StaticResource private_key_regular}"
- Text="Extended Master zprv"
- CopyParameter="{Binding ExtendedMasterZprv}"
+ Label="Extended Master zprv"
+ Value="{Binding ExtendedMasterZprv}"
IsVisible="{Binding !!ExtendedMasterZprv}"
PrivacyModeEnabled="{Binding !ShowSensitiveData}" >
<TextBlock Classes="monoSpaced" Text="{Binding ExtendedMasterZprv}" />
<Separator IsVisible="{Binding !!ExtendedMasterZprv}" />
<c:PreviewItem Icon="{StaticResource fingerprint_regular}"
- Text="Extended Master Fingerprint"
- CopyParameter="{Binding MasterKeyFingerprint}" >
+ Label="Extended Master Fingerprint"
+ Value="{Binding MasterKeyFingerprint}" >
<TextBlock Classes="monoSpaced" Text="{Binding MasterKeyFingerprint}" />
</c:PreviewItem>
<Separator />
<c:PreviewItem Icon="{StaticResource organization_regular}"
- Text="Account Key Path"
- CopyParameter="{Binding AccountKeyPath}" >
+ Label="Account Key Path"
+ Value="{Binding AccountKeyPath}" >
<TextBlock Classes="monoSpaced" Text="{Binding AccountKeyPath}" />
</c:PreviewItem>
<Separator />
<c:PreviewItem Icon="{StaticResource private_key_regular}"
- Text="Extended Account Private Key xpriv"
- CopyParameter="{Binding ExtendedAccountPrivateKey}"
+ Label="Extended Account Private Key xpriv"
+ Value="{Binding ExtendedAccountPrivateKey}"
IsVisible="{Binding !!ExtendedAccountPrivateKey}"
PrivacyModeEnabled="{Binding !ShowSensitiveData}" >
<TextBlock Classes="monoSpaced" Text="{Binding ExtendedAccountPrivateKey}" />
<Separator IsVisible="{Binding !!ExtendedAccountPrivateKey}" />
<c:PreviewItem Icon="{StaticResource private_key_regular}"
- Text="Extended Account Private Key zprv"
- CopyParameter="{Binding ExtendedAccountZprv}"
+ Label="Extended Account Private Key zprv"
+ Value="{Binding ExtendedAccountZprv}"
IsVisible="{Binding !!ExtendedAccountZprv}"
PrivacyModeEnabled="{Binding !ShowSensitiveData}" >
<TextBlock Classes="monoSpaced" Text="{Binding ExtendedAccountZprv}" />
<Separator IsVisible="{Binding !!ExtendedAccountZprv}" />
<c:PreviewItem Icon="{StaticResource key_regular}"
- Text="Public External Output descriptor"
- CopyParameter="{Binding WpkhOutputDescriptors.PublicExternal}">
+ Label="Public External Output descriptor"
+ Value="{Binding WpkhOutputDescriptors.PublicExternal}">
<c:PrivacyContentControl Classes="monoSpaced" Content="{Binding WpkhOutputDescriptors.PublicExternal}" ForceShow="{Binding ShowSensitiveData}" NumberOfPrivacyChars="38" />
</c:PreviewItem>
<c:PreviewItem Icon="{StaticResource key_regular}"
- Text="Public Internal Output descriptor"
- CopyParameter="{Binding WpkhOutputDescriptors.PublicInternal}">
+ Label="Public Internal Output descriptor"
+ Value="{Binding WpkhOutputDescriptors.PublicInternal}">
<c:PrivacyContentControl Classes="monoSpaced" Content="{Binding WpkhOutputDescriptors.PublicInternal}" ForceShow="{Binding ShowSensitiveData}" NumberOfPrivacyChars="38" />
</c:PreviewItem>
<c:PreviewItem Icon="{StaticResource key_regular}"
- Text="Private External Output descriptor"
+ Label="Private External Output descriptor"
IsVisible="{Binding !!WpkhOutputDescriptors.PrivateExternal}"
PrivacyModeEnabled="{Binding !ShowSensitiveData}"
- CopyParameter="{Binding WpkhOutputDescriptors.PrivateExternal}">
+ Value="{Binding WpkhOutputDescriptors.PrivateExternal}">
<c:PrivacyContentControl Classes="monoSpaced" Content="{Binding WpkhOutputDescriptors.PrivateExternal}" ForceShow="{Binding ShowSensitiveData}" NumberOfPrivacyChars="38" />
</c:PreviewItem>
<c:PreviewItem Icon="{StaticResource key_regular}"
- Text="Private Internal Output descriptor"
+ Label="Private Internal Output descriptor"
IsVisible="{Binding !!WpkhOutputDescriptors.PrivateInternal}"
PrivacyModeEnabled="{Binding !ShowSensitiveData}"
- CopyParameter="{Binding WpkhOutputDescriptors.PrivateInternal}">
+ Value="{Binding WpkhOutputDescriptors.PrivateInternal}">
<c:PrivacyContentControl Classes="monoSpaced" Content="{Binding WpkhOutputDescriptors.PrivateInternal}" ForceShow="{Binding ShowSensitiveData}" NumberOfPrivacyChars="38" />
</c:PreviewItem>
<c:PreviewItem Icon="{StaticResource key_regular}"
- Text="Extended Account Public Key"
- CopyParameter="{Binding ExtendedAccountPublicKey}">
+ Label="Extended Account Public Key"
+ Value="{Binding ExtendedAccountPublicKey}">
<c:PrivacyContentControl Classes="monoSpaced" Content="{Binding ExtendedAccountPublicKey}" ForceShow="{Binding ShowSensitiveData}" NumberOfPrivacyChars="38" />
</c:PreviewItem>
<Separator />
<c:PreviewItem Icon="{StaticResource key_regular}"
- Text="Extended Account zpub"
- CopyParameter="{Binding ExtendedAccountZpub}">
+ Label="Extended Account zpub"
+ Value="{Binding ExtendedAccountZpub}">
<c:PrivacyContentControl Classes="monoSpaced" Content="{Binding ExtendedAccountZpub}" ForceShow="{Binding ShowSensitiveData}" NumberOfPrivacyChars="38" />
</c:PreviewItem>
</StackPanel>

MODIFY
WalletWasabi.Fluent/Views/Wallets/Advanced/WalletStatsView.axaml
WalletWasabi.Fluent/Views/Wallets/Advanced/WalletStatsView.axaml
<c:ContentArea Title="{Binding Title}"
EnableNext="True" NextContent="Done">
<StackPanel Spacing="10" Margin="0 20 20 0">
- <c:PreviewItem Text="Number of coins (UTXOs)"
- CopyParameter="{Binding CoinCount}">
+ <c:PreviewItem Label="Number of coins (UTXOs)"
+ Value="{Binding CoinCount}">
<c:PrivacyContentControl Classes="monoSpaced"
NumberOfPrivacyChars="8"
Content="{Binding CoinCount}" />
</c:PreviewItem>
<Separator />
- <c:PreviewItem Text="Unconfirmed balance"
- CopyParameter="{Binding UnconfirmedBalance}">
+ <c:PreviewItem Label="Unconfirmed balance"
+ Value="{Binding UnconfirmedBalance}">
<c:PrivacyContentControl NumberOfPrivacyChars="11" Content="{Binding UnconfirmedBalance, StringFormat={}{0} BTC, Mode=OneWay}" Classes="monoSpaced" />
</c:PreviewItem>
<Separator />
- <c:PreviewItem Text="Confirmed balance"
- CopyParameter="{Binding ConfirmedBalance}">
+ <c:PreviewItem Label="Confirmed balance"
+ Value="{Binding ConfirmedBalance}">
<c:PrivacyContentControl NumberOfPrivacyChars="11" Content="{Binding ConfirmedBalance, StringFormat={}{0} BTC, Mode=OneWay}" Classes="monoSpaced" />
</c:PreviewItem>
<Separator />
- <c:PreviewItem Text="Total balance"
- CopyParameter="{Binding Balance}">
+ <c:PreviewItem Label="Total balance"
+ Value="{Binding Balance}">
<c:PrivacyContentControl NumberOfPrivacyChars="11" Content="{Binding Balance, StringFormat={}{0} BTC, Mode=OneWay}" Classes="monoSpaced" />
</c:PreviewItem>
</StackPanel>

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/History/CoinJoinDetailsView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/History/CoinJoinDetailsView.axaml
<!-- Date -->
<c:PreviewItem Icon="{StaticResource timer_regular}"
- Text="Date"
- CopyParameter="{Binding Date}">
+ Label="Date"
+ Value="{Binding Date}">
<TextBlock Text="{Binding Date}" />
</c:PreviewItem>
<!-- Transaction IDs -->
<c:PreviewItem Icon="{StaticResource transaction_id}"
- Text="Transaction ID">
+ Label="Transaction ID">
<ItemsRepeater Items="{Binding TransactionIds}">
<ItemsRepeater.ItemTemplate>
<DataTemplate>
<!-- Status -->
<c:PreviewItem Icon="{StaticResource status_regular}"
- Text="Status">
+ Label="Status">
<TextBlock Text="{Binding Status}" />
</c:PreviewItem>
<!-- CJ fee -->
<c:PreviewItem Icon="{StaticResource btc_logo}"
- Text="Coinjoin fee:"
- CopyParameter="{Binding CoinJoinFee}">
+ Label="Coinjoin fee:"
+ Value="{Binding CoinJoinFee}">
<TextBlock Text="{Binding CoinJoinFeeString, Mode=OneWay}" />
</c:PreviewItem>

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/History/TransactionDetailsView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/History/TransactionDetailsView.axaml
<!-- Date -->
<c:PreviewItem Icon="{StaticResource timer_regular}"
- Text="Date / Time"
- CopyParameter="{Binding Date, StringFormat='{}{0:MM/dd/yyyy HH:mm}', Mode=OneWay}">
+ Label="Date / Time"
+ Value="{Binding Date, StringFormat='{}{0:MM/dd/yyyy HH:mm}', Mode=OneWay}">
<TextBlock Text="{Binding Date, StringFormat='{}{0:MM/dd/yyyy HH:mm}', Mode=OneWay}" Classes="monoSpaced"/>
</c:PreviewItem>
<Separator />
<!-- Transaction ID -->
<c:PreviewItem Icon="{StaticResource transaction_id}"
- Text="Transaction ID"
- CopyParameter="{Binding TransactionId}">
+ Label="Transaction ID"
+ Value="{Binding TransactionId}">
<c:PrivacyContentControl NumberOfPrivacyChars="48">
<TextBlock Text="{Binding TransactionId}" Classes="monoSpaced"/>
</c:PrivacyContentControl>
<!-- Status -->
<c:PreviewItem Icon="{StaticResource status_regular}"
- Text="Status">
+ Label="Status">
<Panel>
<TextBlock Text="Confirmed" IsVisible="{Binding IsConfirmed}" />
<TextBlock Text="Pending" IsVisible="{Binding !IsConfirmed}" />
<!-- Incoming amount -->
<c:PreviewItem Icon="{StaticResource btc_logo}"
- Text="Amount"
- CopyParameter="{Binding Amount}">
+ Label="Amount"
+ Value="{Binding Amount}">
<TextBlock Text="{Binding Amount, StringFormat={}{0} BTC, Mode=OneWay}" Classes="monoSpaced" />
</c:PreviewItem>
<!-- Block height -->
<c:PreviewItem Icon="{StaticResource block_height}"
- Text="Block height"
- CopyParameter="{Binding BlockHeight}"
+ Label="Block height"
+ Value="{Binding BlockHeight}"
IsVisible="{Binding IsConfirmed}">
<TextBlock Text="{Binding BlockHeight}" />
</c:PreviewItem>
<!-- Confirmations -->
<c:PreviewItem Icon="{StaticResource copy_confirmed}"
- Text="Confirmations"
- CopyParameter="{Binding Confirmations}">
+ Label="Confirmations"
+ Value="{Binding Confirmations}">
<TextBlock Text="{Binding Confirmations}" />
</c:PreviewItem>
<!-- Labels -->
<c:PreviewItem Icon="{StaticResource entities_regular}"
- Text="Labels"
- CopyParameter="{Binding Labels}">
+ Label="Labels"
+ Value="{Binding Labels}">
<c:PrivacyContentControl NumberOfPrivacyChars="20">
<c:TagsBox Padding="0" IsReadOnly="True" Items="{Binding Labels}" />
</c:PrivacyContentControl>

Cannot copy when text is null