public class Dialog<T> : Dialog
Custom modal dialog with a specified result type
Remarks: This provides a way to show a modal dialog with custom contents to the user. A dialog will block user input from the owner form until the dialog is closed.
TType result type of the dialog
Dialog

Properties

AbortButton

public Button AbortButton { get; set; }
Gets or sets the abort button.
inherited fromDialog
Remarks: On some platforms, the abort button would be called automatically if the user presses the escape key
The abort button.

AllowDrop

public virtual bool AllowDrop { get; set; }
Gets or sets a value indicating whether this control can serve as drop target.
inherited fromControl

AutoSize

public bool AutoSize { get; set; }
Gets or sets a value indicating that the window will automatically resize when its content changes
inherited fromWindow
Remarks: Note that if you set both dimensions of the Size and/or Container.ClientSize, this will be set to false.
true to auto size the window when its content changes, false to only auto size when first created

BackgroundColor

public virtual Color BackgroundColor { get; set; }
Gets or sets the color for the background of the control
inherited fromControl
Remarks: Note that on some platforms (e.g. Mac), setting the background color of a control can change the performance characteristics of the control and its children, since it must enable layers to do so.
The color of the background.

Bounds

public Rectangle Bounds { get; set; }
Gets or sets the size and location of the window
inherited fromWindow

Children

public IEnumerable<Control> Children { get; }
Gets an enumeration of all contained child controls, including controls within child containers
inherited fromContainer

ClientSize

public Size ClientSize { get; set; }
Gets or sets the size for the client area of the control
inherited fromContainer
Remarks: The client size differs from the Control.Size in that it excludes the decorations of the container, such as the title bar and border around a Window, or the title and line around a GroupBox.
The size of the client area

Closeable

[DefaultValue(true)] public bool Closeable { get; set; }
Gets or sets a value indicating whether the close button should be shown. Defaults to true
inherited fromWindow
Remarks: Note that on some platforms (e.g. Windows) this also hides the system menu and minimize/maximize buttons. Note that this does not prevent the window from being closed, to do that use the Window.Closing event.
true to show the close button (and in some platforms the system menu), false to hide them.

Content

public Control Content { get; set; }
Gets or sets the main content of the panel.
inherited fromPanel
Remarks: The main content will be offset by the Panel.Padding value specified, and will take up the entire content area of the control. Some controls may have decorations that will surround the content, such as a GroupBox, TabControl, or Window
The child content of the control.

ContextMenu

public ContextMenu ContextMenu { get; set; }
Gets or sets the context menu for the panel.
inherited fromPanel
Remarks: The context menu is usually shown when the user right clicks the control, or in mobile platforms when the user taps and holds their finger down on the control.
The context menu.

ControlObject

public object ControlObject { get; }
Gets the instance of the platform-specific object
inherited fromWidget
Remarks: This can sometimes be useful to get the platform-specific object. Some handlers may not have any backing object for its functionality, so this may be null. It is more preferred to use the Widget.Handler and cast that to the platform-specific handler class which can give you additional methods and helpers to do common tasks. For example, the Application object's handler for OS X has a AddFullScreenMenuItem property to specify if you want full screen support in your app.

Controls

public override IEnumerable<Control> Controls { get; }
Gets an enumeration of controls that are directly contained by this container
inherited fromPanel

Cursor

public virtual Cursor Cursor { get; set; }
Gets or sets the type of cursor to use when the mouse is hovering over the control
inherited fromControl

DataContext

public object DataContext { get; set; }
Gets or sets the data context for this widget for binding
inherited fromBindableWidget
Remarks: Subclasses may override the standard behaviour so that hierarchy of widgets can be taken into account. For example, a Control may return the data context of a parent, if it is not set explicitly.
DataContext

DefaultButton

public Button DefaultButton { get; set; }
Gets or sets the default button.
inherited fromDialog
Remarks: On some platforms, the abort button would be called automatically if the user presses the return key on the form
The default button.

DisplayMode

public DialogDisplayMode DisplayMode { get; set; }
Gets or sets the display mode hint
inherited fromDialog

Enabled

[DefaultValue(true)] public virtual bool Enabled { get; set; }
Gets or sets a value indicating whether this Control (or its children) are enabled and accept user input.
inherited fromControl
Remarks: Typically when a control is disabled, the user cannot do anything with the control or any of its children. Including for example, selecting text in a text control. Certain controls can have a 'Read Only' mode, such as TextBox.ReadOnly which allow the user to select text, but not change its contents.
true if enabled; otherwise, false.

Handler

protected Control.IHandler Handler { get; }
Gets the handler for the widget, ensuring the current thread is the UI thread
inherited fromControl

HasFocus

public virtual bool HasFocus { get; }
Gets a value indicating whether this instance has the keyboard input focus.
inherited fromControl

Icon

public Icon Icon { get; set; }
Gets or sets the icon for the window to show in the menu bar.
inherited fromWindow
Remarks: The icon should have many variations, such as 16x16, 24x24, 32x32, 48x48, 64x64, etc. This ensures that the many places it is used (title bar, task bar, switch window, etc) all have optimized icon sizes. For OS X, the application icon is specified in the .app bundle, not by this value.
The icon for this window.

IsAttached

public bool IsAttached { get; }
Gets a value indicating this control has been attached to a native container
inherited fromControl

IsDataContextChanging

public bool IsDataContextChanging { get; set; }
Gets a value indicating that the BindableWidget.DataContext property is changing.
inherited fromBindableWidget
Remarks: This can be used to determine when to allow certain logic during the update of the data context. It is used to disable binding setters on the model when the data context changes so that a binding does not cause the view model to be updated when the state hasn't been fully set yet.
true if the DataContext is currently changing, false otherwise.

IsDisposed

public bool IsDisposed { get; }
Gets or sets a value indicating whether this Widget has been disposed.
inherited fromWidget
Remarks: When the widget is disposed, it can no longer be used.
true if this instance has been disposed; otherwise, false.

IsMouseCaptured

public bool IsMouseCaptured { get; }
Gets a value indicating this control currently has mouse capture
inherited fromControl
Remarks: Mouse capture can happen during a handled MouseDown event until MouseUp, or it can be captured explicitly via Control.CaptureMouse().

IsSuspended

public bool IsSuspended { get; }
Gets a value indicating whether the layout of child controls is suspended.
inherited fromControl

IsVisualControl

public bool IsVisualControl { get; }
Gets a value indicating this Control is part of the visual tree.
inherited fromControl

Loaded

public bool Loaded { get; }
Gets a value indicating that the control is loaded onto a form, that is it has been created, added to a parent, and shown
inherited fromControl
Remarks: The Control.OnLoad(EventArgs) method sets this value to true after cascading to all children (for a Container) and calling the platform handler's implementation. It is called after adding to a loaded form, or when showing a new form. The Control.OnUnLoad(EventArgs) method will set this value to false when the control is removed from its parent

Location

public Point Location { get; set; }
Gets or sets the location of the window
inherited fromWindow
Remarks: Note that in multi-monitor setups, the origin of the location is at the upper-left of Screen.PrimaryScreen. Also note, that on Linux systems running GTK via Wayland, the location is relative to the Window.Owner when one is set and the Window.WindowStyle is WindowStyle.None; otherwise it will always point to 0, 0 and setting it to different values will have no effect. Using Control.PointToScreen(PointF) on a control within the Window.Owner can be used to position the window relative to specific elements of the owner.

LogicalParent

public Container LogicalParent { get; }
Gets the logical parent control.
inherited fromControl
Remarks: When the control is part of the visual tree (Control.IsVisualControl is true), this returns the logical parent that contains this control. Otherwise this is the same as Control.Parent.
The logical parent.

LogicalPixelSize

public float LogicalPixelSize { get; }
Gets the number of pixels per logical pixel when on a high DPI display.
inherited fromWindow
Remarks: This indicates the number of pixels per logical pixel. All units in Eto.Forms such as control size, drawing operations, etc are in logical pixels. When not in high DPI, this will be 1.0; Retina displays in OS X will return 2; and in windows this matches the scale set in the monitor settings. Use the Window.LogicalPixelSizeChanged to detect when the window is moved to a display with a different DPI.

Maximizable

public bool Maximizable { get; set; }
Gets or sets a value indicating whether this Window can be maximized.
inherited fromWindow
Remarks: This may hide or disable the minimize button on the title bar.
true if maximizable; otherwise, false.

Minimizable

public bool Minimizable { get; set; }
Gets or sets a value indicating whether this Window can be minimized.
inherited fromWindow
Remarks: This may hide or disable the maximize button on the title bar.
true if minimizable; otherwise, false.

MinimumSize

public Size MinimumSize { get; set; }
Gets or sets the minimum size of the panel.
inherited fromPanel

MovableByWindowBackground

public bool MovableByWindowBackground { get; set; }
Gets or sets a value indicating that the window can be moved by click+dragging the window background
inherited fromWindow

NativeHandle

public nint NativeHandle { get; }
Gets the native platform-specific handle for integration purposes
inherited fromWidget

NegativeButtons

public Collection<Button> NegativeButtons { get; }
Gets the negative buttons list, these buttons are automatically added to the dialog.
inherited fromDialog
Remarks: Depending on the platform these buttons can be added on the left side or the right side. The lower the index the closer the button is to the edge.
The negative buttons.

Opacity

public double Opacity { get; set; }
Gets or sets the opacity of the window
inherited fromWindow

Owner

public Window Owner { get; set; }
Gets or sets the owner of this window.
inherited fromWindow
Remarks: This sets the parent window that has ownership over this window. For a Dialog, this will be the window that will be disabled while the modal dialog is shown. With a Form, the specified owner will always be below the current window when shown, and will still be responsive to user input. Typically, but not always, the window will move along with the owner.
The owner of this window.

Padding

public Padding Padding { get; set; }
Gets or sets the padding around the Panel.Content of the panel.
inherited fromPanel

Parent

public Container Parent { get; }
Gets the container which this control has been added to, if any
inherited fromControl

ParentWindow

public Window ParentWindow { get; }
Gets the window this control is contained in
inherited fromControl

Platform

public Platform Platform { get; }
Gets the platform that was used to create the Widget.Handler for this widget
inherited fromWidget
Remarks: This gets set to the current Platform.Instance during the construction of the object

PositiveButtons

public Collection<Button> PositiveButtons { get; }
Gets the positive buttons list, these buttons are automatically added to the dialog.
inherited fromDialog
Remarks: Depending on the platform these buttons can be added on the left side or the right side. The lower the index the closer the button is to the edge.
The positive buttons.

Properties

public PropertyStore Properties { get; }
Gets the dictionary of properties for this widget
inherited fromWidget

Resizable

public bool Resizable { get; set; }
Gets or sets a value indicating whether this Window is resizable.
inherited fromWindow

RestoreBounds

public Rectangle RestoreBounds { get; }
Gets the bounds of the window before it was minimized or maximized, or the current bounds if Window.WindowState is Normal.
inherited fromWindow
Remarks: This is useful to retrieve the desired size and position of the window even though it is currently maximized or minimized.
The restore bounds.

Result

#
public T Result { get; set; }
Gets or sets the result of the dialog

Screen

public Screen Screen { get; }
Gets the screen this window is mostly contained in. Typically defined by the screen center of the window is visible.
inherited fromWindow

ShowInTaskbar

public bool ShowInTaskbar { get; set; }
Gets or sets a value indicating whether this Window will show in the taskbar.
inherited fromWindow
Remarks: Some platforms, e.g. macOS do not show a separate icon for each running window. You may also have to add the LSUIElement key to your app's Info.plist to make your app hidden in the dock. See https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-108256-TPXREF136
true if the window will show in taskbar; otherwise, false.

Size

public virtual Size Size { get; set; }
Gets or sets the size of the control. Use -1 to specify auto sizing for either the width and/or height.
inherited fromControl
Remarks: Setting the size of controls is entirely optional as most controls will size themselves appropriately. When specifying a size, it will be used as the desired size of the control. The container will reposition and resize the control depending on the available size. For a Window, it is preferred to set the Container.ClientSize instead, as various platforms have different sizes of window decorations, toolbars, etc.
The current size of the control

Style

public string Style { get; set; }
Gets or sets the style of this widget
inherited fromWidget
Remarks: Styles allow you to attach custom platform-specific logic to a widget. In your platform-specific assembly, use Add{H} to add the style logic with the same id.
// in your UI
var control = new Button { Style = "mystyle" };

// in your platform assembly
using Eto.Mac.Forms.Controls;

Styles.AddHandler<ButtonHandler>("mystyle", handler => {
	// this is where you can use handler.Control to set properties, handle events, etc.
	handler.Control.BezelStyle = NSBezelStyle.SmallSquare;
});

StyleProvider

public IStyleProvider StyleProvider { get; set; }
Gets or sets the style provider for this container.
inherited fromContainer
Remarks: The style provider is used to style this container and its children.
The style provider.

Styles

public DefaultStyleProvider Styles { get; }
Gets the default style provider for this container.
inherited fromContainer
Remarks: Use this to apply styles to any child controls of this container. By default, styles will apply to all children, including children of children unless DefaultStyleProvider.Inherit is set to false. Typically, you would set Inherit to false when creating composite controls that already have all their styles applied and you don't want any other styles to be inherited.
The default style provider for this container.

SupportedPlatformCommands

public IEnumerable<string> SupportedPlatformCommands { get; }
Gets the supported platform commands that can be used to hook up system functions to user defined logic
inherited fromControl
Remarks: This lists all available commands that can be mapped using the Control.MapPlatformCommand(string, Command) method of the control.
The supported platform commands.

TabIndex

[DefaultValue(2147483647)] public virtual int TabIndex { get; set; }
Gets or sets the tab index order for this control within its container.
inherited fromControl
Remarks: This sets the order when using the tab key to cycle through controls Note that some platforms (Gtk and WinForms) may not support setting the context of the tab order to StackLayout or DynamicLayout containers and may not behave exactly as expected. Use the PlatformFeatures.TabIndexWithCustomContainers flag to determine if it is supported.
The index of the control in the tab order.

TabStop

public override bool TabStop { get; set; }
Gets or sets a value indicating whether the user can get to this control using the tab key. Not used for a window.
inherited fromWindow
Remarks: The tab key only cycles through the controls within a window, so this has no effect for the window itself. Set Control.TabStop on the controls within the window instead.
Always true for a window.
Control.TabStop

Tag

public object Tag { get; set; }
Gets or sets a user-defined object that contains data about the control
inherited fromControl
Remarks: A common use of the tag property is to store data that is associated with the control that you can later retrieve.

Title

public string Title { get; set; }
Gets or sets the title of the window
inherited fromWindow
Remarks: The title of the window is displayed to the user usually at the top of the window, but in cases where you show a window in a mobile environment, this may be the title shown in a navigation controller.
The title of the window

ToolBar

public ToolBar ToolBar { get; set; }
Gets or sets the tool bar for the window.
inherited fromWindow
Remarks: Note that each window can only have a single tool bar
The tool bar for the window

ToolTip

public virtual string ToolTip { get; set; }
Gets or sets the tool tip to show when the mouse is hovered over the control
inherited fromControl

Topmost

public bool Topmost { get; set; }
Gets or sets a value indicating whether this Window is above all other windows.
inherited fromWindow
Remarks: The window should be above all other windows when this is true. In some platforms, this will show above all other windows only when the application has focus.
true if the window should be topmost; otherwise, false.

Visible

[DefaultValue(true)] public virtual bool Visible { get; set; }
Gets or sets a value indicating whether this Control is visible to the user.
inherited fromControl
Remarks: When the visibility of a control is set to false, it will not occupy space in the layout.
true if visible; otherwise, false.

VisualChildren

public IEnumerable<Control> VisualChildren { get; }
Gets an enumeration of all contained child controls in the visual tree, including controls within child containers.
inherited fromContainer

VisualControls

public virtual IEnumerable<Control> VisualControls { get; }
Gets an enumeration of controls that are in the visual tree.
inherited fromControl
Remarks: This is used to specify which controls are contained by this instance that are part of the visual tree. This should include all controls including non-logical Eto controls used for layout.
The visual controls.

VisualParent

public Container VisualParent { get; }
Gets the visual container of this control, if any.
inherited fromControl
Remarks: Some containers may use other Eto controls to layout its children, such as the StackLayout. This will return the parent control that visually contains this control as opposed to Control.Parent which will return the logical parent.
The visual parent of this control.

WindowState

public WindowState WindowState { get; set; }
Gets or sets the state of the window.
inherited fromWindow

WindowStyle

public WindowStyle WindowStyle { get; set; }
Gets or sets the style of this window.
inherited fromWindow

Methods

ApplyStyles

protected override void ApplyStyles(object widget, string style)
Applies the styles to the specified widget up the parent chain.
inherited fromContainer
Remarks: This traverses up the parent chain to apply any cascading styles defined in parent container objects. Call this method on any child widget of a control.
widget (object)Widget to style.
style (string)Style of the widget to apply.

AttachNative

public void AttachNative()
Attaches the control for direct use in a native application
inherited fromControl
Remarks: Use this to use a control directly in a native application. Note that the native application must be running the same framework as the current platform. E.g. a WinForms application can use an Eto.Forms control when using the Eto.WinForms platform. This prepares the control by firing the Control.PreLoad, Control.Load, etc. events.

BringToFront

public void BringToFront()
Brings the window in front of all other windows in the z-order. This should not activate/focus the window.
inherited fromWindow

CaptureMouse

public bool CaptureMouse()
Captures all mouse events to this control.
inherited fromControl
Remarks: This captures all mouse events until Control.ReleaseMouseCapture() is called. Note that not all platforms will allow a mouse capture unless the mouse is currently down.
true if the mouse was captured, false otherwise.

Close

public virtual void Close()
Closes the window
inherited fromWindow
Remarks: Note that once a window is closed, it cannot be shown again in most platforms.

Close

#
public void Close(T result)
Close the dialog with the specified result

Detach

public void Detach()
Detaches the control by removing it from its parent
inherited fromControl
Remarks: This is essentially a shortcut to myControl.Parent.Remove(myControl);

DetachNative

public void DetachNative()
Detaches the control when it is used in a native application, when you want to reuse the control.
inherited fromControl
Remarks: This should only be called after Control.AttachNative() has been called, which is usually done by calling to ToNative(true).

Dispose

protected override void Dispose(bool disposing)
Handles the disposal of this control
inherited fromWindow
disposing (bool)True if the caller called Widget.Dispose() manually, false if being called from a finalizer
Control.Dispose

DoDragDrop

public virtual void DoDragDrop(DataObject data, DragEffects allowedEffects, Image image, PointF cursorOffset)
Starts drag operation using this control as drag source.
inherited fromControl
Remarks: This method can be blocking on some platforms (Wpf, WinForms), and non-blocking on others (Mac, Gtk). Use the Control.DragEnd event to determine when the drag operation is completed and get its resulting DragEffects.
data (DataObject)Drag data.
allowedEffects (DragEffects)Allowed effects.
image (Image)Custom drag image
cursorOffset (PointF)Offset of the cursor to the drag image

DoDragDrop

public virtual void DoDragDrop(DataObject data, DragEffects allowedEffects)
Starts drag operation using this control as drag source.
inherited fromControl
Remarks: This method can be blocking on some platforms (Wpf, WinForms), and non-blocking on others (Mac, Gtk). Use the Control.DragEnd event to determine when the drag operation is completed and get its resulting DragEffects.
data (DataObject)Drag data.
allowedEffects (DragEffects)Allowed action.

FindChild

public Control FindChild(string id)
Finds a child control in this container or any of its child containers with the specified id.
inherited fromContainer
id (string)Identifier of the control to find that matches the Widget.ID.
The child control if found, or null if not.

FindChild

public Control FindChild(Type type, string id = null)
Finds a child control in this container or any of its child containers with the specified type
inherited fromContainer
type (Type)The type of control to find.
id (string = null)Optional identifier of the control to find that matches the Widget.ID.
The child control if found, or null if not.

FindParent

public Container FindParent(string id)
Finds a control in the parent hierarchy with the specified id
inherited fromControl
id (string)Identifier of the parent control to find.
The parent if found, or null if not found.

FindParent

public Container FindParent(Type type, string id = null)
Finds a control in the parent hierarchy with the specified type and Widget.ID if specified
inherited fromControl
type (Type)The type of control to find.
id (string = null)Identifier of the parent control to find, or null to find by type only.
The parent if found, or null if not found.

Focus

public virtual void Focus()
Attempts to set the keyboard input focus to this control, or the first child that accepts focus. For Windows, this will bring it to front and activate it.
inherited fromControl

GetCallback

protected override object GetCallback()
Gets an instance of an object used to perform callbacks to the widget from handler implementations
inherited fromWindow

GetPreferredSize

public SizeF GetPreferredSize()
Gets the preferred size of this control given infinite space available.
inherited fromControl

GetPreferredSize

public SizeF GetPreferredSize(SizeF availableSize)
Gets the preferred size of this control given the specified availableSize.
inherited fromControl
availableSize (SizeF)The available size to determine the preferred size
The preferred size this control would like to be, which can be larger than the specified availableSize.

Initialize

protected void Initialize()
Initializes the widget handler
inherited fromWidget
Remarks: This is typically called from the constructor after all of the logic is completed to construct the object. If your handler interface has the AutoInitializeAttribute set to false, then you are responsible for calling this method in your constructor after calling the creation method on your custom handler.

Invalidate

public void Invalidate()
Queues a repaint of the entire control on the screen and any of its children.
inherited fromControl

Invalidate

public void Invalidate(bool invalidateChildren)
Queues a repaint of the entire control on the screen
inherited fromControl
Remarks: This is only useful when the control is visible.
invalidateChildren (bool)True to invalidate all children, false to only invalidate the container

Invalidate

public void Invalidate(Rectangle rect, bool invalidateChildren)
Queues a repaint of the specified rect of the control
inherited fromControl
Remarks: This is only useful when the control is visible.
rect (Rectangle)Rectangle to repaint
invalidateChildren (bool)True to invalidate all children, false to only invalidate the container

Invalidate

public void Invalidate(Rectangle rect)
Queues a repaint of the specified rect of the control and any children.
inherited fromControl
Remarks: This is only useful when the control is visible.
rect (Rectangle)Rectangle to repaint

MapPlatformCommand

public void MapPlatformCommand(string systemCommand, Command command)
Specifies a command to execute for a platform-specific command
inherited fromControl
Remarks: Some platforms have specific system-defined commands that can be associated with a control. For example, the Mac platform's cut/copy/paste functionality is defined by the system, and if you want to hook into it, you can use this to map it to your own defined logic. The valid values of the systemCommand parameter are defined by each platform, and a list can be retrieved using Control.SupportedPlatformCommands
systemCommand (string)System command
command (Command)Command to execute, or null to restore to the default behavior
This example shows how to extend a control with cut/copy/paste for the mac platform:
var drawable = new Drawable();
if (drawable.Generator.IsMac)
{
	drawable.MapPlatformCommand("cut", new MyCutCommand());
	drawable.MapPlatformCommand("copy", new MyCopyCommand());
	drawable.MapPlatformCommand("paste", new MyPasteCommand());
}

OnApplyCascadingStyles

protected virtual void OnApplyCascadingStyles()
Called when cascading styles should be applied to this control.
inherited fromControl
Remarks: You don't typically have to call this directly, but override it to apply styles to any child item(s) that may need styling at the same time. This is automatically done for any Container based control and its child controls.

OnDataContextChanged

protected override void OnDataContextChanged(EventArgs e)
inherited fromWindow
Remarks: Implementors may override this to fire this event on child widgets in a heirarchy. This allows a control to be bound to its own BindableWidget.DataContext, which would be set on one of the parent control(s).
e (EventArgs)Event arguments

OnLoad

protected override void OnLoad(EventArgs e)
Raises the Control.Load event, and recurses to this container's children
inherited fromContainer

OnLoadComplete

protected override void OnLoadComplete(EventArgs e)
Raises the Control.LoadComplete event, and recurses to this container's children
inherited fromContainer

OnLocationChanged

protected virtual void OnLocationChanged(EventArgs e)
Raises the Window.LocationChanged event.
inherited fromWindow

OnLogicalPixelSizeChanged

protected virtual void OnLogicalPixelSizeChanged(EventArgs e)
inherited fromWindow

OnMouseDown

protected virtual void OnMouseDown(MouseEventArgs e)
Raises the Control.MouseDown event.
inherited fromControl
Remarks: To override default behaviour of the control, set MouseEventArgs.Handled property to true.
e (MouseEventArgs)Event arguments

OnPreLoad

protected override void OnPreLoad(EventArgs e)
Raises the Control.PreLoad event, and recurses to this container's children
inherited fromContainer

OnStyleChanged

protected override void OnStyleChanged(EventArgs e)
Handles when the Style is changed.
inherited fromContainer
Remarks: This applies the cascading styles to the control and any of its children.
e (EventArgs)

OnUnLoad

protected override void OnUnLoad(EventArgs e)
Raises the Control.UnLoad event, and recurses to this container's children
inherited fromContainer

OnWindowStateChanged

protected virtual void OnWindowStateChanged(EventArgs e)
Raises the Window.WindowStateChanged event.
inherited fromWindow

PointFromScreen

public PointF PointFromScreen(PointF point)
Converts a point from screen space to control space.
inherited fromControl

PointToScreen

public PointF PointToScreen(PointF point)
Converts a point from control space to screen space
inherited fromControl

RectangleFromScreen

public RectangleF RectangleFromScreen(RectangleF rect)
Converts a rectangle from screen space to control space.
inherited fromControl
rect (RectangleF)Rectangle in screen space
The rectangle in control space

RectangleToScreen

public RectangleF RectangleToScreen(RectangleF rect)
Converts a rectangle from control space to screen space
inherited fromControl
rect (RectangleF)Rectangle in control space
The rectangle in screen space

Remove

public override void Remove(Control child)
Removes the specified child from the container
inherited fromPanel

Remove

public virtual void Remove(IEnumerable<Control> controls)
Remove the specified controls from this container
inherited fromContainer

RemoveLogicalParent

protected void RemoveLogicalParent(Control child)
Removes the child control from the logical parent of this container.
inherited fromContainer
Remarks: This should be used from containers that use other Eto controls to layout its children but should not be part of the logical heirarchy.
child (Control)Child to remove from this container as the logical parent.

RemoveParent

protected void RemoveParent(Control child)
Removes the specified control from the container.
inherited fromContainer
Remarks: This should only be called on controls that the container owns. Otherwise, call Control.Detach()
child (Control)Child to remove from this container

ResumeLayout

public virtual void ResumeLayout()
Resumes the layout after it has been suspended, and performs a layout
inherited fromControl
Remarks: This can be used to optimize some platforms while adding, removing, or changing many child controls at once. Each call to ResumeLayout() must be balanced with a call to Control.SuspendLayout() before it.

SendToBack

public void SendToBack()
Sends the window behind all other windows in the z-order, and will remain active if it has focus.
inherited fromWindow

SetLogicalParent

protected void SetLogicalParent(Control child)
Sets the logical (non-visual) parent of the specified child control.
inherited fromContainer
Remarks: This is used by layout containers that may use other Eto controls to layout its children that shouldn't be necessary for users to be concerned about. For example, the StackLayout uses a TableLayout internally (for now), but the TableLayout should not be part of the logical tree of controls. If this is not set, then the logical parent of a child is the same as the visual parent.
child (Control)Child to set the logical parent to this container.

SetParent

protected void SetParent(Control child, Action assign = null, Control previousChild = null)
Sets the parent of the specified child to this container
inherited fromContainer
Remarks: This is used by container authors to set the parent of a child before it is added to the underlying platform control. The assign parameter should call the handler method to add the child to the parent.
child (Control)Child to set the parent
assign (Action = null)Method to assign the child to the handler
previousChild (Control = null)Previous child that the new child is replacing.
true, if parent was set, false otherwise.

ShowModal

#
public T ShowModal()
Shows the dialog and blocks until the user closes the dialog

ShowModal

#
public T ShowModal(Control owner)
Shows the dialog and blocks until the user closes the dialog
Remarks: The owner specifies the control on the window that will be blocked from user input until the dialog is closed.
owner (Control)The owner control that is showing the form
The result of the modal dialog

ShowModalAsync

#
public Task<T> ShowModalAsync()
Shows the dialog modally asynchronously

ShowModalAsync

#
public Task<T> ShowModalAsync(Control owner)
Shows the dialog modally asynchronously
Remarks: The owner specifies the control on the window that will be blocked from user input until the dialog is closed.
owner (Control)The owner control that is showing the form

SuspendLayout

public virtual void SuspendLayout()
Suspends the layout of child controls
inherited fromControl
Remarks: This can be used to optimize some platforms while adding, removing, or changing many child controls at once. It disables the calculation of control positioning until Control.ResumeLayout() is called. Each call to SuspendLayout() must be balanced with a call to Control.ResumeLayout().

ToString

public override string ToString()
Gets a string that represents the current object with its ID if specified.
inherited fromWidget
A string value indicating the type and ID (if specified) of this widget.
Object.ToString

TriggerStyleChanged

public void TriggerStyleChanged()
Triggers the StyleChanged event and re-applies the styles to this control and its children.
inherited fromControl

Unbind

public virtual void Unbind()
Unbinds any bindings in the BindableWidget.Bindings collection and removes the bindings
inherited fromBindableWidget

UpdateBindings

public virtual void UpdateBindings(BindingUpdateMode mode = BindingUpdateMode.Source)
Updates all bindings in this widget
inherited fromBindableWidget
Remarks: When you implement IBindableWidgetContainer, this will also update bindings for all of its children.
mode (BindingUpdateMode = BindingUpdateMode.Source)

UpdateLayout

public void UpdateLayout()
Updates the layout of this control if necessary.
inherited fromControl
Remarks: This will ensure the control has had all of its layout applied so you can use its position and size right after this call. Most platforms (except WinForms) use a deferred layout system so that after adding your control to the form dynamically it won't get laid out until the next idle loop. This is useful when you need to know the dimensions of the control immediately. Note that this can be an expensive operation, so it is recommended to only call this method when necessary and after all of the controls have been added/updated.

Events

Closing

public event EventHandler<CancelEventArgs> Closing
Occurs before the window is closed, giving an opportunity to cancel the close operation.
inherited fromWindow

DataContextChanged

public event EventHandler<EventArgs> DataContextChanged
Event to handle when the BindableWidget.DataContext has changed
inherited fromBindableWidget
Remarks: This may be fired in the event of a parent in the hierarchy setting the data context. For example, the Container widget fires this event when it's event is fired.
DataContextChanged

DragDrop

public event EventHandler<DragEventArgs> DragDrop
Occurs when a drag operation is dropped onto the control.
inherited fromControl
Remarks: This should perform any of the actual drop logic and update the control state to reflect the dropped data. Any cleanup should be performed in the Control.DragLeave event, which is called immediately before this event.

DragEnd

public event EventHandler<DragEventArgs> DragEnd
Occurs for a source control after a call to Control.DoDragDrop(DataObject, DragEffects, Image, PointF) when the drag operation has ended. The DragEventArgs.Effects is the final DragEffects used at the drop destination.
inherited fromControl
Remarks: For controls that you are dragging from this event is useful to know what to do with the dragged content after it is dropped in a different control or application.

DragLeave

public event EventHandler<DragEventArgs> DragLeave
Occurs when a drag operation leaves the bounds of the control or the drag operation was completed inside the control.
inherited fromControl
Remarks: Use this event to 'clean up' any state of the control for the current drag operation. This will be called before the Control.DragDrop event.

DragOver

public event EventHandler<DragEventArgs> DragOver
Occurs when a drag operation is over the control and needs updating based on position or keyboard state changes.
inherited fromControl

GotFocus

public event EventHandler<EventArgs> GotFocus
Occurs when the control receives keyboard focus.
inherited fromControl

Load

public event EventHandler<EventArgs> Load
Occurs when the control is displayed on a visible window
inherited fromControl
Remarks: A control is loaded when it is part of the control hierarchy and is shown on a window. When the control is removed from the hierarchy, or the window is closed, the Control.UnLoad event will be called.

LoadComplete

public event EventHandler<EventArgs> LoadComplete
Occurs when the load is complete, which happens after the Control.Load event and before the window/control is shown.
inherited fromControl

LostFocus

public event EventHandler<EventArgs> LostFocus
Occurs when control loses keyboard focus
inherited fromControl

MouseDoubleClick

public event EventHandler<MouseEventArgs> MouseDoubleClick
Occurs when a mouse button is double clicked within the bounds of the control
inherited fromControl
Remarks: If you do not set the MouseEventArgs.Handled property to true, and the default behaviour of the control does not accept double clicks, the Control.MouseDown event will be called for each click of the mouse button. For example, if the user clicks twice in succession, the following will be called:
  1. MouseDown for the first click
  2. MouseDoubleClick for the second click
  3. If Handled has not been set in #2, MouseDown will be called a 2nd time
MouseDoubleClick

MouseDown

public event EventHandler<MouseEventArgs> MouseDown
Occurs when a mouse button has been pressed
inherited fromControl
Remarks: Controls will typically capture the mouse after a mouse button is pressed and will be released only after the Control.MouseUp event.
MouseDown
Control.MouseUp

MouseMove

public event EventHandler<MouseEventArgs> MouseMove
Occurs when mouse moves within the bounds of the control, or when the mouse is captured
inherited fromControl
Remarks: The mouse is captured after a Control.MouseDown event within the control, and is released when the mouse button is released
MouseMove

PreviewKeyDown

public event EventHandler<KeyMonitorEventArgs> PreviewKeyDown
Occurs when a key is pressed anywhere in this window, before the focused control handles it.
inherited fromWindow
Remarks: Control.KeyDown is raised by the control that has the keyboard focus and bubbles up the widget tree, so it only ever sees keys that Eto itself is routing. This is raised for every key going to the window no matter what owns the focus, including content that is not part of the widget tree at all such as a control hosted by NativeControlHost or a WebView, whose keys are handled entirely by the platform and never surface as Eto events. Use it to notice that the user is typing somewhere in a window; use Control.KeyDown to handle or suppress a key. This only observes, it never consumes: the focused control always goes on to receive the key, which is why KeyMonitorEventArgs has no way to mark the event as handled. Keys are reported as pressed, ahead of any input method, so a key that only contributes to an IME composition is still reported even though it produces no text on its own. This reports keys, not text, and the character a key produces is deliberately not included. Working out which window a key is destined for is best effort on some platforms. On Windows it is inferred from the focused window at the time the key is dispatched, which can be wrong while a platform modal or menu tracking loop is running.

PreviewKeyUp

public event EventHandler<KeyMonitorEventArgs> PreviewKeyUp
Occurs when a key is released anywhere in this window, before the focused control handles it.
inherited fromWindow

Shown

public event EventHandler<EventArgs> Shown
Occurs when the control is shown on the screen
inherited fromControl
Remarks: This event fires when the Control.Visible property changes, or when initially showing a control on a form.

TextInput

public event EventHandler<TextInputEventArgs> TextInput
Occurs when text is input for the control. Currently only partially supported on iOS.
inherited fromControl

ThemeChanged

public event EventHandler<EventArgs> ThemeChanged
Occurs when the control's theme changes either due to a system theme change or when Application.Instance.CurrentTheme is set.
inherited fromControl

UnLoad

public event EventHandler<EventArgs> UnLoad
Occurs when the control is unloaded, which happens when removed from the control hierarchy or the window is closed.
inherited fromControl