diff --git a/src/Ursa.Themes.Semi/Controls/IPv4Box.axaml b/src/Ursa.Themes.Semi/Controls/IPv4Box.axaml
index 2f5095b..4a55d21 100644
--- a/src/Ursa.Themes.Semi/Controls/IPv4Box.axaml
+++ b/src/Ursa.Themes.Semi/Controls/IPv4Box.axaml
@@ -8,6 +8,27 @@
+
+
+
+
+
+
@@ -20,6 +41,7 @@
+
();
clipboard?.SetTextAsync(s);
}
+
+ public static KeyGesture? CopyKeyGesture { get; } = AvaloniaLocator.Current.GetService()?.Copy.FirstOrDefault();
+ public static KeyGesture? PasteKeyGesture { get; } = AvaloniaLocator.Current.GetService()?.Paste.FirstOrDefault();
+ public static KeyGesture? CutKeyGesture { get; } = AvaloniaLocator.Current.GetService()?.Cut.FirstOrDefault();
- public async void OnPaste()
+ public async void Paste()
{
IClipboard? clipboard = AvaloniaLocator.Current.GetService();
if (clipboard is null) return;
- string? s = await clipboard.GetTextAsync();
+ string s = await clipboard.GetTextAsync();
if (IPAddress.TryParse(s, out var address))
{
IPAddress = address;
}
}
+
+ public async void Cut()
+ {
+ IClipboard? clipboard = AvaloniaLocator.Current.GetService();
+ if(clipboard is null) return;
+ string s = string.Join(".", _firstText?.Text, _secondText?.Text, _thirdText?.Text, _fourthText?.Text);
+ await clipboard.SetTextAsync(s);
+ Clear();
+ }
}
public static class TextPresenterHelper