Class AppForm
A base class for a UI embeddable in Avalonia.Controls.TabItem controls.
[TypeStore]
public class AppForm : UserControl, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, INamed, IInputElement, IDataTemplateHost, ISetterValue
- Inheritance
-
AvaloniaObjectAnimatableStyledElementVisualLayoutableInteractiveInputElementControlTemplatedControlContentControlUserControlAppForm
- Implements
-
IDataContextProviderILogicalIThemeVariantHostIResourceHostIResourceNodeIStyleHostISetLogicalParentISetInheritanceParentINamedIInputElementIDataTemplateHostISetterValue
- Derived
- Inherited Members
-
UserControl.OnCreateAutomationPeer()ContentControl.ContentPropertyContentControl.ContentTemplatePropertyContentControl.HorizontalContentAlignmentPropertyContentControl.VerticalContentAlignmentPropertyContentControl.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)ContentControl.RegisterContentPresenter(ContentPresenter)ContentControl.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.GetTemplateFocusTarget()TemplatedControl.OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)TemplatedControl.OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)TemplatedControl.OnApplyTemplate(TemplateAppliedEventArgs)TemplatedControl.OnTemplateChanged(AvaloniaPropertyChangedEventArgs)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.OnLoaded(RoutedEventArgs)Control.OnUnloaded(RoutedEventArgs)Control.OnSizeChanged(SizeChangedEventArgs)Control.OnAttachedToVisualTreeCore(VisualTreeAttachmentEventArgs)Control.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs)Control.OnGotFocus(FocusChangedEventArgs)Control.OnLostFocus(FocusChangedEventArgs)Control.OnPointerReleased(PointerReleasedEventArgs)Control.OnKeyUp(KeyEventArgs)Control.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.OnAccessKey(RoutedEventArgs)InputElement.OnGettingFocus(FocusChangingEventArgs)InputElement.OnLosingFocus(FocusChangingEventArgs)InputElement.OnKeyDown(KeyEventArgs)InputElement.OnTextInput(TextInputEventArgs)InputElement.OnPointerEntered(PointerEventArgs)InputElement.OnPointerExited(PointerEventArgs)InputElement.OnPointerMoved(PointerEventArgs)InputElement.OnPointerPressed(PointerPressedEventArgs)InputElement.GetNextTabStopOverride()InputElement.GetPreviousTabStopOverride()InputElement.GetFirstFocusableElementOverride()InputElement.GetLastFocusableElementOverride()InputElement.OnPointerCaptureLost(PointerCaptureLostEventArgs)InputElement.OnPointerWheelChanged(PointerWheelEventArgs)InputElement.OnTapped(TappedEventArgs)InputElement.OnRightTapped(TappedEventArgs)InputElement.OnDoubleTapped(TappedEventArgs)InputElement.OnHolding(HoldingRoutedEventArgs)InputElement.UpdateIsEffectivelyEnabled()InputElement.GetIsHoldingEnabled(StyledElement)InputElement.GetIsHoldWithMouseEnabled(StyledElement)InputElement.FocusableInputElement.IsEnabledInputElement.CursorInputElement.IsKeyboardFocusWithinInputElement.IsFocusedInputElement.IsHitTestVisibleInputElement.IsPointerOverInputElement.IsTabStopInputElement.IsEffectivelyEnabledInputElement.TabIndexInputElement.KeyBindingsInputElement.IsEnabledCoreInputElement.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)Interactive.BuildEventRoute(RoutedEvent)Layoutable.DesiredSizePropertyLayoutable.WidthPropertyLayoutable.HeightPropertyLayoutable.MinWidthPropertyLayoutable.MaxWidthPropertyLayoutable.MinHeightPropertyLayoutable.MaxHeightPropertyLayoutable.MarginPropertyLayoutable.HorizontalAlignmentPropertyLayoutable.VerticalAlignmentPropertyLayoutable.UseLayoutRoundingPropertyLayoutable.UpdateLayout()Layoutable.Measure(Size)Layoutable.Arrange(Rect)Layoutable.InvalidateMeasure()Layoutable.InvalidateArrange()Layoutable.AffectsMeasure<T>(params AvaloniaProperty[])Layoutable.AffectsArrange<T>(params AvaloniaProperty[])Layoutable.MeasureCore(Size)Layoutable.MeasureOverride(Size)Layoutable.ArrangeCore(Rect)Layoutable.ArrangeOverride(Size)Layoutable.OnMeasureInvalidated()Layoutable.OnVisualParentChanged(Visual, Visual)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.AffectsRender<T>(params AvaloniaProperty[])Visual.OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)Visual.InvalidateMirrorTransform()Visual.BoundsVisual.ClipToBoundsVisual.ClipVisual.IsEffectivelyVisibleVisual.IsVisibleVisual.OpacityVisual.OpacityMaskVisual.CacheModeVisual.EffectVisual.HasMirrorTransformVisual.RenderTransformVisual.RenderTransformOriginVisual.FlowDirectionVisual.ZIndexVisual.VisualChildrenVisual.VisualRootVisual.BypassFlowDirectionPoliciesVisual.AttachedToVisualTreeVisual.DetachedFromVisualTreeStyledElement.DataContextPropertyStyledElement.NamePropertyStyledElement.ParentPropertyStyledElement.TemplatedParentPropertyStyledElement.ThemePropertyStyledElement.BeginInit()StyledElement.EndInit()StyledElement.ApplyStyling()StyledElement.InitializeIfNeeded()StyledElement.OnDataContextBeginUpdate()StyledElement.OnDataContextEndUpdate()StyledElement.OnInitialized()StyledElement.NameStyledElement.ClassesStyledElement.DataContextStyledElement.IsInitializedStyledElement.StylesStyledElement.StyleKeyStyledElement.ResourcesStyledElement.TemplatedParentStyledElement.ThemeStyledElement.LogicalChildrenStyledElement.PseudoClassesStyledElement.StyleKeyOverrideStyledElement.ParentStyledElement.ActualThemeVariantStyledElement.AttachedToLogicalTreeStyledElement.DetachedFromLogicalTreeStyledElement.DataContextChangedStyledElement.InitializedStyledElement.ResourcesChangedStyledElement.ActualThemeVariantChangedAnimatable.TransitionsPropertyAnimatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)Animatable.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.RaisePropertyChanged<T>(DirectPropertyBase<T>, T, T)AvaloniaObject.SetAndRaise<T>(DirectPropertyBase<T>, ref T, T)AvaloniaObject.InheritanceParentAvaloniaObject.this[AvaloniaProperty]AvaloniaObject.this[IndexerDescriptor]AvaloniaObject.DispatcherAvaloniaObject.PropertyChanged
- Extension Methods
Constructors
AppForm()
Constructor
public AppForm()
Fields
fTitleText
The title text of the form.
protected string fTitleText
Field Value
Properties
ClosableByUser
When true then the user can close this page by middle clicking the parent ParentTabPage
public bool ClosableByUser { get; protected set; }
Property Value
Context
Gets the form context.
public FormContext Context { get; }
Property Value
FormId
A unique id among all pages hosted in the same Avalonia.Controls.TabControl
public string FormId { get; }
Property Value
IsClosing
True while closing.
public bool IsClosing { get; }
Property Value
IsFormInitialized
True when initialization is done.
public bool IsFormInitialized { get; protected set; }
Property Value
IsModal
True when this is displayed in a modal dialog
public bool IsModal { get; }
Property Value
IsSelectedForm
True when the ParentTabPage is the selected page in its parent Avalonia.Controls.TabControl
public bool IsSelectedForm { get; }
Property Value
IsSetupDone
True when the setup of this page is done.
public bool IsSetupDone { get; protected set; }
Property Value
ModalResult
The modal result of the modal dialog displaying this instance.
Setting this to anything other than None closes the container form.
public virtual ModalResult ModalResult { get; set; }
Property Value
ParentControl
The parent TabItem or Window.
public ContentControl ParentControl { get; }
Property Value
- ContentControl
ParentTabControl
The parent Avalonia.Controls.TabControl
public TabControl ParentTabControl { get; }
Property Value
- TabControl
ParentTabPage
The parent Avalonia.Controls.TabItem hosting this page.
public TabItem ParentTabPage { get; }
Property Value
- TabItem
ParentWindow
The window dialog showing the form.
public Window ParentWindow { get; }
Property Value
- Window
TitleText
The text to display in the tab
public string TitleText { get; set; }
Property Value
Methods
CanCloseForm()
Returns true if this page can close.
public virtual bool CanCloseForm()
Returns
CloseForm()
Closes this page.
This default implementation it just removes the parent ParentTabPage from its parent Avalonia.Controls.TabControl.
public virtual void CloseForm()
Closed()
Called just after the form is closed.
protected virtual void Closed()
Closing()
Called just before the form is closed.
protected virtual void Closing()
FindFirstFocusableControl(Control)
Returns the control that is last added to the container
protected virtual Control FindFirstFocusableControl(Control Container)
Parameters
ContainerControlThe container to search.
Returns
- Control
The first focusable control, if any; otherwise, null.
FormInitialize()
Called in order to initialize the form
protected virtual void FormInitialize()
FormInitialized()
Called just after form initialization
protected virtual void FormInitialized()
FormInitializing()
Called just before form initialization
protected virtual void FormInitializing()
HandleBroadcasterEvent(string, IDictionary<string, object>)
Handles a broadcaster event.
protected virtual void HandleBroadcasterEvent(string EventName, IDictionary<string, object> Args)
Parameters
EventNamestringThe broadcaster event name.
ArgsIDictionary<string, object>The broadcaster event arguments.
OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)
Called when the control is added to a rooted visual tree.
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
Parameters
eVisualTreeAttachmentEventArgsThe visual tree attachment event arguments.
PassResultBack()
Passes any result to the caller of the form, if any. Useful with modal forms.
protected virtual void PassResultBack()
ProcessEscapeKey()
It is called when the escape key is pressed.
Returning true indicates that the key press is handled.
NOTE: By default, when is a modal dialog, it sets ModalResult to Cancel, and closes the form.
protected virtual bool ProcessEscapeKey()
Returns
- bool
True if the escape key was processed; otherwise, false.
ProcessFormOptions()
Processes the form options
protected virtual void ProcessFormOptions()
ProcessKeyDown(KeyEventArgs)
It is called by the OnKeyDown() method.
Returns true if processes the key
protected virtual bool ProcessKeyDown(KeyEventArgs e)
Parameters
eKeyEventArgsThe key event arguments.
Returns
- bool
True if the key was processed; otherwise, false.
SetAsSelectedForm()
Set the ParentTabPage as the selected tab page of its parent Avalonia.Controls.TabControl
public virtual void SetAsSelectedForm()
Setup()
This is called just after the Context is assigned.
NOTE: When this method is called the form has already a parent, the Context is assigned buth the FormInitialize() has not been called.
protected virtual void Setup()
Setup(FormContext)
This is called from the AppFormPagerHandler or the AppFormDialog right after the form creation.
NOTE: When this is called the form has just added to its parent.
public void Setup(FormContext Context)
Parameters
ContextFormContextThe form context.
Start()
Executes any first operation on the form.
NOTE: When this method is called the form has already a parent, the Context is assigned and the FormInitialize() is finished.
protected virtual Task Start()
Returns
TitleTextChanged()
Called when the TitleText property changes.
protected virtual void TitleTextChanged()