示例#1
0
        /// <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));
        }
示例#2
0
 /// <summary>
 /// Clears the contents of the clipbaord.
 /// </summary>
 public static Task ClearAsync()
 => AvaloniaGlobals.GetRequiredService <IClipboard> ().ClearAsync();
示例#3
0
 /// <summary>
 /// Sets the text contents of the clipboard.
 /// </summary>
 public static Task SetTextAsync(string text)
 => AvaloniaGlobals.GetRequiredService <IClipboard> ().SetTextAsync(text);
示例#4
0
 /// <summary>
 /// Gets the contents of the clipboard as text.
 /// </summary>
 public static Task <string> GetTextAsync()
 => AvaloniaGlobals.GetRequiredService <IClipboard> ().GetTextAsync();