Esempio n. 1
0
        public void Cut ()
        {
            if (!document.IsTextSelected)
                return;

            var text = document.SelectedText;
            AsyncHelper.RunSync (() => Avalonia.AvaloniaGlobals.ClipboardInterface.SetTextAsync (text));

            document.DeleteSelection ();
        }
Esempio n. 2
0
        /// <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();
        }