/// <summary> /// Initializes a new instance of the Form class. /// </summary> public Form() : base(AvaloniaGlobals.GetRequiredService <IWindowingPlatform> ().CreateWindow()) { TitleBar = Controls.AddImplicitControl(new FormTitleBar()); Resizeable = true; Window.SetSystemDecorations(SystemDecorations.None); Window.SetExtendClientAreaToDecorationsHint(true); Window.Closing = () => { var args = new CancelEventArgs(); OnClosing(args); return(args.Cancel); }; Window.Resize(new Size(DefaultSize.Width, DefaultSize.Height)); }
/// <summary> /// Clears the contents of the clipbaord. /// </summary> public static Task ClearAsync() => AvaloniaGlobals.GetRequiredService <IClipboard> ().ClearAsync();
/// <summary> /// Sets the text contents of the clipboard. /// </summary> public static Task SetTextAsync(string text) => AvaloniaGlobals.GetRequiredService <IClipboard> ().SetTextAsync(text);
/// <summary> /// Gets the contents of the clipboard as text. /// </summary> public static Task <string> GetTextAsync() => AvaloniaGlobals.GetRequiredService <IClipboard> ().GetTextAsync();