Class RDFormsFormWindow
A window that shows a VB form: its RDFormsFormView, titled with the form's caption.
public sealed class RDFormsFormWindow : Window, INotifyPropertyChanged, IDataContextProvider, IThemeVariantHost, IResourceHost, IResourceNode, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, INamed, IInputElement, IDataTemplateHost, ISetterValue, ICloseable, IStyleHost, ILogicalRoot, ILogical, IFocusScope, IMenuHost
- Inheritance
-
AvaloniaObjectAnimatableStyledElementVisualLayoutableInteractiveInputElementControlTemplatedControlContentControlTopLevelWindowBaseWindowRDFormsFormWindow
- Implements
-
IDataContextProviderIThemeVariantHostIResourceHostIResourceNodeISetLogicalParentISetInheritanceParentINamedIInputElementIDataTemplateHostISetterValueICloseableIStyleHostILogicalRootILogicalIFocusScope
- Inherited Members
-
Window.SizeToContentPropertyWindow.ExtendClientAreaToDecorationsHintPropertyWindow.ExtendClientAreaTitleBarHeightHintPropertyWindow.IsExtendedIntoWindowDecorationsPropertyWindow.WindowDecorationMarginPropertyWindow.OffScreenMarginPropertyWindow.WindowDecorationsPropertyWindow.WindowDecorationsThemePropertyWindow.ShowActivatedPropertyWindow.ShowInTaskbarPropertyWindow.ClosingBehaviorPropertyWindow.WindowStatePropertyWindow.TitlePropertyWindow.IconPropertyWindow.WindowStartupLocationPropertyWindow.CanResizePropertyWindow.CanMinimizePropertyWindow.CanMaximizePropertyWindow.WindowClosedEventWindow.WindowOpenedEventWindow.BeginMoveDrag(PointerPressedEventArgs)Window.BeginResizeDrag(WindowEdge, PointerPressedEventArgs)Window.Close()Window.Hide()Window.Show()Window.Show(Window)Window.ShowDialog(Window)Window.ShowDialog<TResult>(Window)Window.PlatformImplWindow.OwnedWindowsWindow.SizeToContentWindow.TitleWindow.ExtendClientAreaToDecorationsHintWindow.ExtendClientAreaTitleBarHeightHintWindow.IsExtendedIntoWindowDecorationsWindow.WindowDecorationMarginWindow.OffScreenMarginWindow.WindowDecorationsWindow.WindowDecorationsThemeWindow.SystemDecorationsWindow.ShowActivatedWindow.ShowInTaskbarWindow.ClosingBehaviorWindow.WindowStateWindow.CanResizeWindow.CanMinimizeWindow.CanMaximizeWindow.IconWindow.WindowStartupLocationWindow.PositionWindow.IsDialogWindow.ClosingWindowBase.IsActivePropertyWindowBase.OwnerPropertyWindowBase.TopmostPropertyWindowBase.Activate()WindowBase.IsActiveWindowBase.ScreensWindowBase.OwnerWindowBase.TopmostWindowBase.DesktopScalingWindowBase.ActivatedWindowBase.DeactivatedWindowBase.PositionChangedWindowBase.ResizedTopLevel.ClientSizePropertyTopLevel.FrameSizePropertyTopLevel.TransparencyLevelHintPropertyTopLevel.ActualTransparencyLevelPropertyTopLevel.TransparencyBackgroundFallbackPropertyTopLevel.ActualThemeVariantPropertyTopLevel.RequestedThemeVariantPropertyTopLevel.SystemBarColorPropertyTopLevel.AutoSafeAreaPaddingPropertyTopLevel.BackRequestedEventTopLevel.TryGetPlatformHandle()TopLevel.SetSystemBarColor(Control, SolidColorBrush)TopLevel.GetSystemBarColor(Control)TopLevel.GetAutoSafeAreaPadding(Control)TopLevel.GetTopLevel(Visual)TopLevel.ClientSizeTopLevel.FrameSizeTopLevel.TransparencyLevelHintTopLevel.ActualTransparencyLevelTopLevel.TransparencyBackgroundFallbackTopLevel.RequestedThemeVariantTopLevel.RendererDiagnosticsTopLevel.RenderScalingTopLevel.StorageProviderTopLevel.InsetsManagerTopLevel.InputPaneTopLevel.LauncherTopLevel.ClipboardTopLevel.FocusManagerTopLevel.OpenedTopLevel.ClosedTopLevel.ScalingChangedTopLevel.BackRequestedContentControl.ContentPropertyContentControl.ContentTemplatePropertyContentControl.HorizontalContentAlignmentPropertyContentControl.VerticalContentAlignmentPropertyContentControl.ContentContentControl.ContentTemplateContentControl.PresenterContentControl.HorizontalContentAlignmentContentControl.VerticalContentAlignmentTemplatedControl.BackgroundPropertyTemplatedControl.BackgroundSizingPropertyTemplatedControl.BorderBrushPropertyTemplatedControl.BorderThicknessPropertyTemplatedControl.CornerRadiusPropertyTemplatedControl.FontFamilyPropertyTemplatedControl.FontFeaturesPropertyTemplatedControl.FontSizePropertyTemplatedControl.FontStylePropertyTemplatedControl.FontWeightPropertyTemplatedControl.FontStretchPropertyTemplatedControl.ForegroundPropertyTemplatedControl.LetterSpacingPropertyTemplatedControl.PaddingPropertyTemplatedControl.TemplatePropertyTemplatedControl.IsTemplateFocusTargetPropertyTemplatedControl.TemplateAppliedEventTemplatedControl.GetIsTemplateFocusTarget(Control)TemplatedControl.ApplyTemplate()TemplatedControl.BackgroundTemplatedControl.BackgroundSizingTemplatedControl.BorderBrushTemplatedControl.BorderThicknessTemplatedControl.CornerRadiusTemplatedControl.FontFamilyTemplatedControl.FontFeaturesTemplatedControl.FontSizeTemplatedControl.FontStyleTemplatedControl.FontWeightTemplatedControl.FontStretchTemplatedControl.ForegroundTemplatedControl.LetterSpacingTemplatedControl.PaddingTemplatedControl.TemplateTemplatedControl.TemplateAppliedControl.FocusAdornerPropertyControl.TagPropertyControl.ContextMenuPropertyControl.ContextFlyoutPropertyControl.RequestBringIntoViewEventControl.LoadedEventControl.UnloadedEventControl.SizeChangedEventControl.FocusAdornerControl.DataTemplatesControl.ContextMenuControl.ContextFlyoutControl.IsLoadedControl.TagControl.LoadedControl.UnloadedControl.SizeChangedInputElement.FocusablePropertyInputElement.IsEnabledPropertyInputElement.IsEffectivelyEnabledPropertyInputElement.CursorPropertyInputElement.IsKeyboardFocusWithinPropertyInputElement.IsFocusedPropertyInputElement.IsHitTestVisiblePropertyInputElement.IsPointerOverPropertyInputElement.IsTabStopPropertyInputElement.GotFocusEventInputElement.GettingFocusEventInputElement.LostFocusEventInputElement.LosingFocusEventInputElement.KeyDownEventInputElement.KeyUpEventInputElement.TabIndexPropertyInputElement.TextInputEventInputElement.TextInputMethodClientRequestedEventInputElement.PointerEnteredEventInputElement.PointerExitedEventInputElement.PointerMovedEventInputElement.PointerPressedEventInputElement.PointerReleasedEventInputElement.PointerCaptureLostEventInputElement.PointerWheelChangedEventInputElement.ContextRequestedEventInputElement.ContextCanceledEventInputElement.IsHoldingEnabledPropertyInputElement.IsHoldWithMouseEnabledPropertyInputElement.PinchEventInputElement.PinchEndedEventInputElement.PullGestureEventInputElement.PullGestureEndedEventInputElement.SwipeGestureEventInputElement.SwipeGestureEndedEventInputElement.ScrollGestureEventInputElement.ScrollGestureInertiaStartingEventInputElement.ScrollGestureEndedEventInputElement.PointerTouchPadGestureMagnifyEventInputElement.PointerTouchPadGestureRotateEventInputElement.PointerTouchPadGestureSwipeEventInputElement.TappedEventInputElement.RightTappedEventInputElement.HoldingEventInputElement.DoubleTappedEventInputElement.Focus(NavigationMethod, KeyModifiers)InputElement.GetIsHoldingEnabled(StyledElement)InputElement.GetIsHoldWithMouseEnabled(StyledElement)InputElement.FocusableInputElement.IsEnabledInputElement.CursorInputElement.IsKeyboardFocusWithinInputElement.IsFocusedInputElement.IsHitTestVisibleInputElement.IsPointerOverInputElement.IsTabStopInputElement.IsEffectivelyEnabledInputElement.TabIndexInputElement.KeyBindingsInputElement.GestureRecognizersInputElement.GotFocusInputElement.GettingFocusInputElement.LostFocusInputElement.LosingFocusInputElement.KeyDownInputElement.KeyUpInputElement.TextInputInputElement.TextInputMethodClientRequestedInputElement.PointerEnteredInputElement.PointerExitedInputElement.PointerMovedInputElement.PointerPressedInputElement.PointerReleasedInputElement.PointerCaptureLostInputElement.PointerWheelChangedInputElement.ContextRequestedInputElement.ContextCanceledInputElement.PinchInputElement.PinchEndedInputElement.PullGestureInputElement.PullGestureEndedInputElement.ScrollGestureInputElement.ScrollGestureInertiaStartingInputElement.ScrollGestureEndedInputElement.PointerTouchPadGestureMagnifyInputElement.PointerTouchPadGestureRotateInputElement.SwipeGestureInputElement.SwipeGestureEndedInputElement.PointerTouchPadGestureSwipeInputElement.TappedInputElement.RightTappedInputElement.HoldingInputElement.DoubleTappedInteractive.RaiseEvent(RoutedEventArgs)Layoutable.DesiredSizePropertyLayoutable.WidthPropertyLayoutable.HeightPropertyLayoutable.MinWidthPropertyLayoutable.MaxWidthPropertyLayoutable.MinHeightPropertyLayoutable.MaxHeightPropertyLayoutable.MarginPropertyLayoutable.HorizontalAlignmentPropertyLayoutable.VerticalAlignmentPropertyLayoutable.UseLayoutRoundingPropertyLayoutable.UpdateLayout()Layoutable.Measure(Size)Layoutable.Arrange(Rect)Layoutable.InvalidateMeasure()Layoutable.InvalidateArrange()Layoutable.WidthLayoutable.HeightLayoutable.MinWidthLayoutable.MaxWidthLayoutable.MinHeightLayoutable.MaxHeightLayoutable.MarginLayoutable.HorizontalAlignmentLayoutable.VerticalAlignmentLayoutable.DesiredSizeLayoutable.IsMeasureValidLayoutable.IsArrangeValidLayoutable.UseLayoutRoundingLayoutable.EffectiveViewportChangedLayoutable.LayoutUpdatedVisual.BoundsPropertyVisual.ClipToBoundsPropertyVisual.ClipPropertyVisual.IsVisiblePropertyVisual.OpacityPropertyVisual.OpacityMaskPropertyVisual.CacheModePropertyVisual.EffectPropertyVisual.HasMirrorTransformPropertyVisual.RenderTransformPropertyVisual.RenderTransformOriginPropertyVisual.FlowDirectionPropertyVisual.VisualParentPropertyVisual.ZIndexPropertyVisual.GetFlowDirection(Visual)Visual.SetFlowDirection(Visual, FlowDirection)Visual.InvalidateVisual()Visual.Render(DrawingContext)Visual.BoundsVisual.ClipToBoundsVisual.ClipVisual.IsEffectivelyVisibleVisual.IsVisibleVisual.OpacityVisual.OpacityMaskVisual.CacheModeVisual.EffectVisual.HasMirrorTransformVisual.RenderTransformVisual.RenderTransformOriginVisual.FlowDirectionVisual.ZIndexVisual.AttachedToVisualTreeVisual.DetachedFromVisualTreeStyledElement.DataContextPropertyStyledElement.NamePropertyStyledElement.ParentPropertyStyledElement.TemplatedParentPropertyStyledElement.ThemePropertyStyledElement.BeginInit()StyledElement.EndInit()StyledElement.ApplyStyling()StyledElement.NameStyledElement.ClassesStyledElement.DataContextStyledElement.IsInitializedStyledElement.StylesStyledElement.StyleKeyStyledElement.ResourcesStyledElement.TemplatedParentStyledElement.ThemeStyledElement.ParentStyledElement.ActualThemeVariantStyledElement.AttachedToLogicalTreeStyledElement.DetachedFromLogicalTreeStyledElement.DataContextChangedStyledElement.InitializedStyledElement.ResourcesChangedStyledElement.ActualThemeVariantChangedAnimatable.TransitionsPropertyAnimatable.TransitionsAvaloniaObject.CheckAccess()AvaloniaObject.VerifyAccess()AvaloniaObject.ClearValue(AvaloniaProperty)AvaloniaObject.ClearValue<T>(AvaloniaProperty<T>)AvaloniaObject.ClearValue<T>(StyledProperty<T>)AvaloniaObject.ClearValue<T>(DirectPropertyBase<T>)AvaloniaObject.GetHashCode()AvaloniaObject.GetValue(AvaloniaProperty)AvaloniaObject.GetValue<T>(StyledProperty<T>)AvaloniaObject.GetValue<T>(DirectPropertyBase<T>)AvaloniaObject.GetBaseValue<T>(StyledProperty<T>)AvaloniaObject.IsAnimating(AvaloniaProperty)AvaloniaObject.IsSet(AvaloniaProperty)AvaloniaObject.SetValue<T>(StyledProperty<T>, T, BindingPriority)AvaloniaObject.SetValue<T>(DirectPropertyBase<T>, T)AvaloniaObject.SetCurrentValue<T>(StyledProperty<T>, T)AvaloniaObject.Bind(AvaloniaProperty, BindingBase)AvaloniaObject.CoerceValue(AvaloniaProperty)AvaloniaObject.this[AvaloniaProperty]AvaloniaObject.this[IndexerDescriptor]AvaloniaObject.DispatcherAvaloniaObject.PropertyChanged
Remarks
The window's client area is the form's: its size is the root's Width and Height, in pixels, and follows them. A user
who resizes the window sets them. The client area scrolls in its Scroller, by the root's ScrollLeft and
ScrollTop, over at least its ScrollWidth by ScrollHeight, and raises the root's Scroll. The form's menus are on its
MenuBar, above the client area, and a menu item's shortcut chooses it before a control or the root sees the key. Enter clicks the
focused CommandButton, or else the form's first CommandButton whose Default is True, and Esc the first whose Cancel is True, with
no key event, the root's included: a button that is hidden or disabled takes no key, and a combo's open list keeps both keys. The button Enter clicks has
the default look, and no other (see RDFormsCommandButton). While it is open, the window is its root's
IMenuHost, registered with MenuHosts, and a right release over a component whose ContextMenu names
one of the form's menus pops it up at the pointer, after the component's MouseUp and Click. The window follows the root's Caption, Icon,
MaxButton, MinButton and ShowInTaskbar. Its StartUpPosition chooses where it starts: CenterOwner and CenterScreen centre
it, and Manual and Windows Default leave its place to the window system.
The controls and the root raise their events to the sink set on the window with SetEventSink(Control, IComponentEventSink?). A window with no sink raises none. The root's own events, as VB6 raises them:
-
Resize, inside Avalonia.Controls.Window.Show() the first time the window is shown, and once for each change of the root's
WidthorHeightafter that. A size the root already has raises none, and neither does showing the window again after it was hidden. - Activate, as the window becomes the active one of its Program's form windows, after the Resize that shows it; Deactivate on the window of that program that was, before it. Another application, or another program's window, taking the activation and giving it back raises nothing. A window whose root is disabled is shown without being activated.
- The focus, as the window is activated: after the Activate, the control that last had the focus on the form takes it again, or the first control of the tab order that can take it, with a GotFocus. A form with none raises its own GotFocus. The control that has the focus raises its LostFocus before the form's Deactivate, and a form with none its own.
- DblClick, on a double click's second press on none of the form's controls, in place of its MouseDown.
-
QueryUnload, then Unload, as the user closes the window, with an
UnloadModeof 0. A handler that setsCancelto another value keeps the window open. Unload() raises them as VB'sUnloadstatement does, and Avalonia.Controls.Window.Close() closes the window and raises neither, as VB'sEnddoes. A window whose UnloadRequestHandler is set raises neither as the user closes it: it stays open and hands the close to the handler. -
KeyDown, KeyPress and KeyUp, for a key pressed while none of the form's controls has the focus, and for every key first where
the root's
KeyPreviewis True.
Initialize, Load and Terminate are the program's to raise: the window raises none of them.
Constructors
RDFormsFormWindow(FormDefinition)
Creates a window that shows a form.
public RDFormsFormWindow(FormDefinition form)
Parameters
formFormDefinitionThe form.
Remarks
Its file lists show the machine's file system, from the process's current directory.
Exceptions
- ArgumentNullException
formis null.- ArgumentException
The root of
formis not a Form.
RDFormsFormWindow(FormDefinition, IFileSystem)
Creates a window that shows a form, with the file system its file lists show.
public RDFormsFormWindow(FormDefinition form, IFileSystem fileSystem)
Parameters
formFormDefinitionThe form.
fileSystemIFileSystemThe file system the form's file lists show, from its current directory.
Exceptions
- ArgumentNullException
formorfileSystemis null.- ArgumentException
The root of
formis not a Form.
Properties
ActiveControl
The component whose control has the focus on the form, or had it last: VB's ActiveControl. null where
none of the form's controls has had the focus.
public ComponentInstance? ActiveControl { get; }
Property Value
Remarks
A SetFocus call names its control here at once, before the focus moves.
KeepSystemTheme
Whether the window keeps the system's theme: RD-VBA's App.KeepSystemTheme, which the host gives each window it makes.
public bool KeepSystemTheme { get; set; }
Property Value
Remarks
false, the default, shows the form in the light theme variant whatever the application's theme, as VB6 shows a form in Windows' light colours. true shows it in the application's theme variant, and follows it as it changes.
The form's system colours, its menu bar's included, are drawn in the window's variant, with FormPalette's palette for it; a colour set as RGB is drawn as it is. The value can change while the window is shown: the form is drawn again in its new variant. Each window has its own value.
MenuBar
The form's menu bar, above its client area: hidden while none of the bar's items is visible.
public RDFormsMenuBar MenuBar { get; }
Property Value
PoppedUpMenu
The menu PopupMenu(FormMenuItem, double?, double?, PopupMenuAlignment, FormMenuItem?) last popped up, while it is open: null once it has closed.
public ContextMenu? PoppedUpMenu { get; }
Property Value
- ContextMenu
Program
The program the form is one of, whose windows share one active form: Activate, Deactivate, and the GotFocus and LostFocus that come with them, follow the activation among that program's windows only.
public RDFormsProgram Program { get; init; }
Property Value
Remarks
Default unless it is set as the window is made: every window given none is of the one program.
Root
The form's root.
public ComponentInstance Root { get; }
Property Value
Scroller
The scroll viewer the client area is in: its size is the form's Width and Height, and its offset the form's
ScrollLeft and ScrollTop.
public ScrollViewer Scroller { get; }
Property Value
- ScrollViewer
UnloadRequestHandler
What handles a close the user or the system asks for, in place of the window's own QueryUnload and Unload: null, the default, for a window that raises them itself.
public Action<int>? UnloadRequestHandler { get; set; }
Property Value
Remarks
A host whose program raises the form's QueryUnload and Unload itself, such as one whose program runs in another process, sets it.
The window then refuses the close, raises neither event, and calls the handler with the close's UnloadMode: 0 for the
close box or Alt+F4, 2 as the system shuts down, 5 as the window's owner closes. The handler is called on the UI thread after the
close is refused, never inside it. Once the program has unloaded the form, the host closes the window with
Avalonia.Controls.Window.Close(), which raises nothing; a program that cancelled leaves it open.
View
The form's client area.
public RDFormsFormView View { get; }
Property Value
Methods
Assign(ComponentInstance, MethodDefinition, IReadOnlyList<FormValue?>, FormValue)
Assigns one of the properties that the window answers for a control of the form, as a program's code assigns it. Call it on the UI thread.
public void Assign(ComponentInstance component, MethodDefinition property, IReadOnlyList<FormValue?> arguments, FormValue value)
Parameters
componentComponentInstanceA component the form shows.
propertyMethodDefinitionThe property: one of
component's class's Methods that IsProperty.argumentsIReadOnlyList<FormValue?>The property's arguments, as Invoke(ComponentInstance, MethodDefinition, IReadOnlyList<FormValue?>, CodeUnit) takes a method's, such as the index of
List(Index).valueFormValueThe value assigned, of the property's type (Value): a number for a number, which the window rounds and checks as it does an argument, and for
ItemIconan object, as Invoke(ComponentInstance, MethodDefinition, IReadOnlyList<FormValue?>, CodeUnit) gives it.
Exceptions
- ArgumentNullException
component,propertyorargumentsis null.- ArgumentException
componentis not shown on the form, orpropertyis not a property of its class.- InvalidOperationException
The call is not on the UI thread.
- FormErrorException
The assignment is refused with VB's error, and changes nothing: the errors of Invoke(ComponentInstance, MethodDefinition, IReadOnlyList<FormValue?>, CodeUnit) for the arguments and for the value, then 383 for a read-only property, and those of the list members (see Invoke(ComponentInstance, MethodDefinition, IReadOnlyList<FormValue?>, CodeUnit)).
Invoke(ComponentInstance, MethodDefinition, IReadOnlyList<FormValue?>, CodeUnit)
Runs one of the methods of the root or of a control of the form, or reads one of the properties the window answers, as a program's code calls it. Call it on the UI thread.
public FormValue Invoke(ComponentInstance component, MethodDefinition method, IReadOnlyList<FormValue?> arguments, CodeUnit unit = CodeUnit.Pixel)
Parameters
componentComponentInstanceThe root, or a component the form shows.
methodMethodDefinitionThe method, or the property (IsProperty): one of
component's class's Methods.argumentsIReadOnlyList<FormValue?>The call's arguments, in the order of the method's parameters: null for an argument left out, and none past the last one given. A
Variantparameter takes any value and the method coerces it; a parameter of another type takes a value of that type.unitCodeUnitThe unit the code reads and writes positions and sizes in, which
Movetakes.
Returns
Remarks
Move sets Left, then Top, Width and Height, as many as it is given, in unit
(see CodeUnits). It checks every value before it sets one: a negative size is error 5, and a value past a Long in
twips is error 6. In VB6, a value is rounded to a whole twip, half to even. On the root, a Move that
changes the size raises one Resize, where setting Width and then Height raises two.
SetFocus is error 5 while the window is not shown, and on a control that is hidden or disabled. Otherwise
ActiveControl names the control at once, and the focus moves after the call returns, with the LostFocus of the control
that had it, then the GotFocus of this one. Where another of the program's forms is the active one, this window is activated. A
control that has the focus already raises nothing, and so does the root's SetFocus on the active form. SetFocus raises
no Validate. A disabled or hidden container makes its controls refuse the focus, and the root's SetFocus activates a shown form
that is not the active one: these two rules were not measured with VB6, and RDForms sets them.
ZOrder brings a control to the front of its plane in its container, for a Position of 0 or none, and sends it to the
back for 1. A windowless control stays under every windowed one, and a container takes its controls with it. The position is an
Integer, rounded half to even: another number is error 5, and a string that is not a number, or Null, is error 13.
Refresh draws the component and its contents again. On the root or a PictureBox whose AutoRedraw is False, it raises
Paint inside the call. VB6's Refresh was not measured: RDForms sets this rule.
A Data control's UpdateRecord and UpdateControls are as UpdateRecord() and
UpdateControls(): error 91, as the control opens no recordset.
A ListBox's and a ComboBox's list members are as RDFormsListBox and RDFormsComboBox run them: AddItem,
RemoveItem and Clear return none, and a property that IsProperty returns its value
(Assign(ComponentInstance, MethodDefinition, IReadOnlyList<FormValue?>, FormValue) assigns it). An index is an Integer, rounded half to even, and Null is error 94. AddItem is error 5
for an index outside 0 to ListCount, and RemoveItem for one outside the items; ItemData, ItemIcon and
Selected are error 381 for an index outside the items, and List is "" there; ListIndex is error 380 for a
value outside -1 to ListCount - 1. ItemIcon, an RD-VBA addition, is an object (FromObject(object?)):
the bytes of the item's picture file, or Nothing. It is assigned one too: anything else is error 13, and a picture
Inspect(byte[]?, out PictureInfo) refuses is error 481. ListIndex, ListCount, NewIndex and SelCount
are Integers. Past 32767, a count or an index is a Long: RDForms sets this rule.
Exceptions
- ArgumentNullException
component,methodorargumentsis null.- ArgumentException
componentis neither the root nor shown on the form, ormethodis not a method of its class.- InvalidOperationException
The call is not on the UI thread.
- FormErrorException
The call is refused with VB's error, and changes nothing:
- 450 for too many arguments, 449 for a required one left out, 448 for one left out before one given;
- 13 for a value that is not a number, 94 for Null where
Movetakes a number, and 6 for a number out of range; - 5 for a value the method refuses, and for
SetFocuswhere nothing can take the focus; - 438 for a method of the class that the window does not run.
OnClosed(EventArgs)
Raises the Avalonia.Controls.TopLevel.Closed event.
protected override void OnClosed(EventArgs e)
Parameters
eEventArgsThe event args.
OnClosing(WindowClosingEventArgs)
Raises the Avalonia.Controls.Window.Closing event.
protected override void OnClosing(WindowClosingEventArgs e)
Parameters
eWindowClosingEventArgsThe event args.
Remarks
A type that derives from Avalonia.Controls.Window may override Avalonia.Controls.Window.OnClosing(Avalonia.Controls.WindowClosingEventArgs). The overridden method must call Avalonia.Controls.Window.OnClosing(Avalonia.Controls.WindowClosingEventArgs) on the base class if the Avalonia.Controls.Window.Closing event needs to be raised.
OnOpened(EventArgs)
Raises the Avalonia.Controls.TopLevel.Opened event.
protected override void OnOpened(EventArgs e)
Parameters
eEventArgsThe event args.
OnResized(WindowResizedEventArgs)
Raises the Avalonia.Controls.WindowBase.Resized event.
protected override void OnResized(WindowResizedEventArgs e)
Parameters
eWindowResizedEventArgsAn EventArgs that contains the event data.
PopupMenu(FormMenuItem, double?, double?, PopupMenuAlignment, FormMenuItem?)
Pops up the items of one of the form's menus, as VB's PopupMenu method does, at a point of the client area. The menu
raises its Click as it opens, as it does on the bar, and an item chosen from it raises its own.
public Task PopupMenu(FormMenuItem menu, double? x = null, double? y = null, PopupMenuAlignment alignment = PopupMenuAlignment.Left, FormMenuItem? boldItem = null)
Parameters
menuFormMenuItemThe menu whose items pop up: a hidden top-level menu is the usual one.
xdouble?The point's horizontal coordinate in the root's scale, or null for the pointer's.
ydouble?The point's vertical coordinate in the root's scale, or null for the pointer's.
alignmentPopupMenuAlignmentWhere the menu goes across from the point.
boldItemFormMenuItemAn item of the menu, at any depth, to show in bold, as VB's
BoldCommandargument, or null. An item that is not in the menu bolds none.
Returns
- Task
A task that completes when the menu closes, after the Click of an item chosen from it. A menu that holds no items shows nothing and raises nothing, and the task returned has already completed.
Exceptions
- ArgumentNullException
menuis null.- ArgumentException
menuis not one of the form's menus.
Unload()
Unloads the form as VB's Unload statement does: raises the root's QueryUnload, with an UnloadMode of 1, then its
Unload, and closes the window unless a handler set Cancel.
public bool Unload()