fix compile warnings.
MODIFY
WalletWasabi.Gui/Controls/EditableTextBlock.cs
WalletWasabi.Gui/Controls/EditableTextBlock.cs
@@ -58,7 +58,9 @@ namespace WalletWasabi.Gui.Controls
if (!InEditMode)
{
- if (e.ClickCount == 1 && e.InputModifiers == InputModifiers.LeftMouseButton && IsFocused)
+#pragma warning disable CS0618 // Type or member is obsolete
+ if (e.ClickCount == 1 && e.GetCurrentPoint(this).Properties.IsLeftButtonPressed && IsFocused)
+#pragma warning restore CS0618 // Type or member is obsolete
{
EditClickTimer.Start();
}
@@ -72,7 +74,7 @@ namespace WalletWasabi.Gui.Controls
}
else
{
- e.Device.Capture(_textBox);
+ e.GetCurrentPoint(this).Pointer.Capture(_textBox);
}
}
},
@@ -90,7 +92,7 @@ namespace WalletWasabi.Gui.Controls
}
else
{
- e.Device.Capture(_textBox);
+ e.GetCurrentPoint(this).Pointer.Capture(_textBox);
}
}
},
@@ -188,7 +190,9 @@ namespace WalletWasabi.Gui.Controls
ReadMode = false;
InEditMode = true;
+#pragma warning disable CS0618 // Type or member is obsolete
_root.MouseDevice.Capture(_textBox);
+#pragma warning restore CS0618 // Type or member is obsolete
_textBox.SelectionStart = 0;
_textBox.SelectionEnd = Text.Length;
_textBox.CaretIndex = Text.Length;
@@ -210,7 +214,9 @@ namespace WalletWasabi.Gui.Controls
InEditMode = false;
ReadMode = true;
+#pragma warning disable CS0618 // Type or member is obsolete
_root.MouseDevice.Capture(null);
+#pragma warning restore CS0618 // Type or member is obsolete
}
}
}

MODIFY
WalletWasabi.Gui/Controls/ExtendedListBox.cs
WalletWasabi.Gui/Controls/ExtendedListBox.cs
@@ -15,20 +15,18 @@ namespace WalletWasabi.Gui.Controls
AddHandler(PointerPressedEvent,
(sender, e) =>
{
- if (e.MouseButton == MouseButton.Left || e.MouseButton == MouseButton.Right)
+ var properties = e.GetCurrentPoint(this).Properties;
+
+ if (properties.IsLeftButtonPressed || properties.IsRightButtonPressed)
{
UpdateSelectionFromEventSource(
e.Source,
true,
- (e.InputModifiers & InputModifiers.Shift) != 0,
- (e.InputModifiers & InputModifiers.Control) != 0);
+ e.KeyModifiers.HasFlag(KeyModifiers.Shift),
+ e.KeyModifiers.HasFlag(KeyModifiers.Control));
}
},
RoutingStrategies.Tunnel, true);
}
-
- protected override void OnPointerPressed(PointerPressedEventArgs e)
- {
- }
}
}

MODIFY
WalletWasabi.Gui/Controls/MultiTextBox.cs
WalletWasabi.Gui/Controls/MultiTextBox.cs
@@ -192,7 +192,7 @@ namespace WalletWasabi.Gui.Controls
{
var eventArgs = eventPattern?.EventArgs as PointerPressedEventArgs;
var uiConfig = Application.Current.Resources[Global.UiConfigResourceKey] as UiConfig;
- if (uiConfig?.Autocopy is true && eventArgs?.MouseButton == MouseButton.Left)
+ if (uiConfig?.Autocopy is true && eventArgs?.GetCurrentPoint(this).Properties.IsLeftButtonPressed == true)
{
if (CopyOnClick)
{

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/TransactionViewerViewModel.cs
@@ -76,7 +76,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
- sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
+ sfd.Directory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
}
var window = (Application.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime).MainWindow;

MODIFY
WalletWasabi.Gui/Dialogs/AvaloniaControlsExtensions.cs
WalletWasabi.Gui/Dialogs/AvaloniaControlsExtensions.cs
@@ -56,11 +56,11 @@ namespace Avalonia.Controls
: @"/path/to/the/file";
string defaultTextInput = me is OpenFileDialog
- ? Path.Combine(me.InitialDirectory ?? "", me.InitialFileName ?? "")
+ ? Path.Combine(me.Directory ?? "", me.InitialFileName ?? "")
: me is SaveFileDialog sfd
? Path.ChangeExtension(
Path.Combine(
- string.IsNullOrEmpty(me.InitialDirectory) ? Path.GetDirectoryName(exampleFilePath) : me.InitialDirectory,
+ string.IsNullOrEmpty(me.Directory) ? Path.GetDirectoryName(exampleFilePath) : me.Directory,
string.IsNullOrEmpty(me.InitialFileName) ? Path.GetFileName(exampleFilePath) : me.InitialFileName),
string.IsNullOrEmpty(sfd.DefaultExtension) ? "ext" : sfd.DefaultExtension)
: throw new NotImplementedException();

MODIFY
WalletWasabi.Gui/ManagedDialogs/ManagedFileChooser.xaml.cs
WalletWasabi.Gui/ManagedDialogs/ManagedFileChooser.xaml.cs
@@ -10,6 +10,7 @@ using Avalonia.Markup.Xaml;
namespace WalletWasabi.Gui.ManagedDialogs
{
+ [Obsolete]
internal class ManagedFileChooser : UserControl
{
private Control _quickLinksRoot;
@@ -25,6 +26,7 @@ namespace WalletWasabi.Gui.ManagedDialogs
private ManagedFileChooserViewModel Model => DataContext as ManagedFileChooserViewModel;
+
private void OnPointerPressed(object sender, PointerPressedEventArgs e)
{
if (!((e.Source as StyledElement)?.DataContext is ManagedFileChooserItemViewModel model))

MODIFY
WalletWasabi.Gui/ManagedDialogs/ManagedFileChooserViewModel.cs
WalletWasabi.Gui/ManagedDialogs/ManagedFileChooserViewModel.cs
@@ -13,6 +13,7 @@ using WalletWasabi.Gui.ViewModels;
namespace WalletWasabi.Gui.ManagedDialogs
{
+ [Obsolete]
internal class ManagedFileChooserViewModel : ViewModelBase
{
public event Action CancelRequested;

MODIFY
WalletWasabi.Gui/ManagedDialogs/ManagedFileDialogExtensions.cs
WalletWasabi.Gui/ManagedDialogs/ManagedFileDialogExtensions.cs
+using System;
using System.Linq;
using System.Threading.Tasks;
using Avalonia;
@@ -7,6 +8,7 @@ using Avalonia.Platform;
namespace WalletWasabi.Gui.ManagedDialogs
{
+ [Obsolete]
public static class ManagedFileDialogExtensions
{
private class ManagedSystemDialogImpl : ISystemDialogImpl

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
@@ -92,7 +92,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
- ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
+ ofd.Directory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
}
var window = (Application.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime).MainWindow;

fix compile warnings.