public void Cut () { if (!document.IsTextSelected) return; var text = document.SelectedText; AsyncHelper.RunSync (() => Avalonia.AvaloniaGlobals.ClipboardInterface.SetTextAsync (text)); document.DeleteSelection (); }
/// <summary> /// Copies the selected text of the TextBox to the clipboard and removes it from the TextBox. /// </summary> public void Cut() { if (!document.IsTextSelected) { return; } var text = document.SelectedText; AsyncHelper.RunSync(() => Modern.WindowKit.AvaloniaGlobals.GetRequiredService <IClipboard> ().SetTextAsync(text)); document.DeleteSelection(); }