restore lurking wife mode, but break saving
MODIFY
WalletWasabi.Gui/Controls/EditableTextBlock.cs
WalletWasabi.Gui/Controls/EditableTextBlock.cs
@@ -99,7 +99,7 @@ namespace WalletWasabi.Gui.Controls
public static readonly DirectProperty<EditableTextBlock, string> TextProperty = TextBlock.TextProperty.AddOwner<EditableTextBlock>(
o => o.Text,
(o, v) => o.Text = v,
- defaultBindingMode: BindingMode.TwoWay,
+ defaultBindingMode: BindingMode.OneWay,
enableDataValidation: true);
[Content]
@@ -142,6 +142,15 @@ namespace WalletWasabi.Gui.Controls
set { SetValue(ReadModeProperty, value); }
}
+ public static readonly StyledProperty<bool> ReadOnlyModeProperty =
+ AvaloniaProperty.Register<EditableTextBlock, bool>(nameof(ReadOnlyMode), defaultValue: true, defaultBindingMode: BindingMode.TwoWay);
+
+ public bool ReadOnlyMode
+ {
+ get { return GetValue(ReadOnlyModeProperty); }
+ set { SetValue(ReadOnlyModeProperty, value); }
+ }
+
protected override void OnTemplateApplied(TemplateAppliedEventArgs e)
{
base.OnTemplateApplied(e);
@@ -180,6 +189,8 @@ namespace WalletWasabi.Gui.Controls
}
private void EnterEditMode()
+ {
+ if (!ReadOnlyMode)
{
EditText = Text;
ReadMode = false;
@@ -195,6 +206,11 @@ namespace WalletWasabi.Gui.Controls
_textBox.Focus();
});
}
+ else
+ {
+ InEditMode = false;
+ }
+ }
private void ExitEditMode(bool restore = false)
{

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabView.xaml
</Grid>
</Grid>
- <controls:EditableTextBlock Text="{Binding Label, Mode=TwoWay}" InEditMode="{Binding InEditMode}" Grid.Column="1" />
+ <controls:EditableTextBlock Text="{Binding Label, ConverterParameter=27, Converter={StaticResource LurkingWifeModeStringConverter}, Mode=OneWay}"
+ InEditMode="{Binding InEditMode}"
+ ReadOnlyMode="{Binding IsLurkingWifeMode}" Grid.Column="1" />
</Grid>
</Grid>
</DataTemplate>

MODIFY
WalletWasabi.Gui/ViewModels/AddressViewModel.cs
WalletWasabi.Gui/ViewModels/AddressViewModel.cs
@@ -61,6 +61,7 @@ namespace WalletWasabi.Gui.ViewModels
Global.UiConfig.WhenAnyValue(x => x.LurkingWifeMode).Subscribe(_ =>
{
+ this.RaisePropertyChanged(nameof(IsLurkingWifeMode));
this.RaisePropertyChanged(nameof(Address));
this.RaisePropertyChanged(nameof(Label));
}).DisposeWith(Disposables);
@@ -81,6 +82,8 @@ namespace WalletWasabi.Gui.ViewModels
});
}
+ public bool IsLurkingWifeMode => Global.UiConfig.LurkingWifeMode is true;
+
public bool ClipboardNotificationVisible
{
get => _clipboardNotificationVisible;

restore lurking wife mode, but break saving