protected Window(IWindowBaseImpl window) { this.window = window; adapter = new ControlAdapter(this); window.Input = OnInput; window.Paint = OnPaint; window.Resized = OnResize; window.Closed = () => Closed?.Invoke(this, EventArgs.Empty); window.Deactivated = () => Deactivated?.Invoke(this, EventArgs.Empty); window.Resize(new Size(DefaultSize.Width, DefaultSize.Height)); }
/// <summary> /// Initializes a new instance of the Window class. /// </summary> internal WindowBase(IWindowBaseImpl window) { this.window = window; adapter = new ControlAdapter(this); window.Input = OnInput; window.Paint = DoPaint; window.Resized = OnResize; window.Closed = () => Closed?.Invoke(this, EventArgs.Empty); window.Deactivated = () => { // If we're clicking off the form, deactivate any active menus Application.ActiveMenu?.Deactivate(); Deactivated?.Invoke(this, EventArgs.Empty); }; }