Table of Contents

Class AppForm

Namespace
Tripous.Desktop
Assembly
Tripous.Desktop.dll

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
AvaloniaObject
Animatable
StyledElement
Visual
Layoutable
Interactive
InputElement
Control
TemplatedControl
ContentControl
UserControl
AppForm
Implements
IDataContextProvider
ILogical
IThemeVariantHost
IResourceHost
IResourceNode
IStyleHost
ISetLogicalParent
ISetInheritanceParent
INamed
IInputElement
IDataTemplateHost
ISetterValue
Derived
Inherited Members
UserControl.OnCreateAutomationPeer()
ContentControl.ContentProperty
ContentControl.ContentTemplateProperty
ContentControl.HorizontalContentAlignmentProperty
ContentControl.VerticalContentAlignmentProperty
ContentControl.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
ContentControl.RegisterContentPresenter(ContentPresenter)
ContentControl.Content
ContentControl.ContentTemplate
ContentControl.Presenter
ContentControl.HorizontalContentAlignment
ContentControl.VerticalContentAlignment
TemplatedControl.BackgroundProperty
TemplatedControl.BackgroundSizingProperty
TemplatedControl.BorderBrushProperty
TemplatedControl.BorderThicknessProperty
TemplatedControl.CornerRadiusProperty
TemplatedControl.FontFamilyProperty
TemplatedControl.FontFeaturesProperty
TemplatedControl.FontSizeProperty
TemplatedControl.FontStyleProperty
TemplatedControl.FontWeightProperty
TemplatedControl.FontStretchProperty
TemplatedControl.ForegroundProperty
TemplatedControl.LetterSpacingProperty
TemplatedControl.PaddingProperty
TemplatedControl.TemplateProperty
TemplatedControl.IsTemplateFocusTargetProperty
TemplatedControl.TemplateAppliedEvent
TemplatedControl.GetIsTemplateFocusTarget(Control)
TemplatedControl.ApplyTemplate()
TemplatedControl.GetTemplateFocusTarget()
TemplatedControl.OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)
TemplatedControl.OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)
TemplatedControl.OnApplyTemplate(TemplateAppliedEventArgs)
TemplatedControl.OnTemplateChanged(AvaloniaPropertyChangedEventArgs)
TemplatedControl.Background
TemplatedControl.BackgroundSizing
TemplatedControl.BorderBrush
TemplatedControl.BorderThickness
TemplatedControl.CornerRadius
TemplatedControl.FontFamily
TemplatedControl.FontFeatures
TemplatedControl.FontSize
TemplatedControl.FontStyle
TemplatedControl.FontWeight
TemplatedControl.FontStretch
TemplatedControl.Foreground
TemplatedControl.LetterSpacing
TemplatedControl.Padding
TemplatedControl.Template
TemplatedControl.TemplateApplied
Control.FocusAdornerProperty
Control.TagProperty
Control.ContextMenuProperty
Control.ContextFlyoutProperty
Control.RequestBringIntoViewEvent
Control.LoadedEvent
Control.UnloadedEvent
Control.SizeChangedEvent
Control.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.FocusAdorner
Control.DataTemplates
Control.ContextMenu
Control.ContextFlyout
Control.IsLoaded
Control.Tag
Control.Loaded
Control.Unloaded
Control.SizeChanged
InputElement.FocusableProperty
InputElement.IsEnabledProperty
InputElement.IsEffectivelyEnabledProperty
InputElement.CursorProperty
InputElement.IsKeyboardFocusWithinProperty
InputElement.IsFocusedProperty
InputElement.IsHitTestVisibleProperty
InputElement.IsPointerOverProperty
InputElement.IsTabStopProperty
InputElement.GotFocusEvent
InputElement.GettingFocusEvent
InputElement.LostFocusEvent
InputElement.LosingFocusEvent
InputElement.KeyDownEvent
InputElement.KeyUpEvent
InputElement.TabIndexProperty
InputElement.TextInputEvent
InputElement.TextInputMethodClientRequestedEvent
InputElement.PointerEnteredEvent
InputElement.PointerExitedEvent
InputElement.PointerMovedEvent
InputElement.PointerPressedEvent
InputElement.PointerReleasedEvent
InputElement.PointerCaptureLostEvent
InputElement.PointerWheelChangedEvent
InputElement.ContextRequestedEvent
InputElement.ContextCanceledEvent
InputElement.IsHoldingEnabledProperty
InputElement.IsHoldWithMouseEnabledProperty
InputElement.PinchEvent
InputElement.PinchEndedEvent
InputElement.PullGestureEvent
InputElement.PullGestureEndedEvent
InputElement.SwipeGestureEvent
InputElement.SwipeGestureEndedEvent
InputElement.ScrollGestureEvent
InputElement.ScrollGestureInertiaStartingEvent
InputElement.ScrollGestureEndedEvent
InputElement.PointerTouchPadGestureMagnifyEvent
InputElement.PointerTouchPadGestureRotateEvent
InputElement.PointerTouchPadGestureSwipeEvent
InputElement.TappedEvent
InputElement.RightTappedEvent
InputElement.HoldingEvent
InputElement.DoubleTappedEvent
InputElement.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.Focusable
InputElement.IsEnabled
InputElement.Cursor
InputElement.IsKeyboardFocusWithin
InputElement.IsFocused
InputElement.IsHitTestVisible
InputElement.IsPointerOver
InputElement.IsTabStop
InputElement.IsEffectivelyEnabled
InputElement.TabIndex
InputElement.KeyBindings
InputElement.IsEnabledCore
InputElement.GestureRecognizers
InputElement.GotFocus
InputElement.GettingFocus
InputElement.LostFocus
InputElement.LosingFocus
InputElement.KeyDown
InputElement.KeyUp
InputElement.TextInput
InputElement.TextInputMethodClientRequested
InputElement.PointerEntered
InputElement.PointerExited
InputElement.PointerMoved
InputElement.PointerPressed
InputElement.PointerReleased
InputElement.PointerCaptureLost
InputElement.PointerWheelChanged
InputElement.ContextRequested
InputElement.ContextCanceled
InputElement.Pinch
InputElement.PinchEnded
InputElement.PullGesture
InputElement.PullGestureEnded
InputElement.ScrollGesture
InputElement.ScrollGestureInertiaStarting
InputElement.ScrollGestureEnded
InputElement.PointerTouchPadGestureMagnify
InputElement.PointerTouchPadGestureRotate
InputElement.SwipeGesture
InputElement.SwipeGestureEnded
InputElement.PointerTouchPadGestureSwipe
InputElement.Tapped
InputElement.RightTapped
InputElement.Holding
InputElement.DoubleTapped
Interactive.RaiseEvent(RoutedEventArgs)
Interactive.BuildEventRoute(RoutedEvent)
Layoutable.DesiredSizeProperty
Layoutable.WidthProperty
Layoutable.HeightProperty
Layoutable.MinWidthProperty
Layoutable.MaxWidthProperty
Layoutable.MinHeightProperty
Layoutable.MaxHeightProperty
Layoutable.MarginProperty
Layoutable.HorizontalAlignmentProperty
Layoutable.VerticalAlignmentProperty
Layoutable.UseLayoutRoundingProperty
Layoutable.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.Width
Layoutable.Height
Layoutable.MinWidth
Layoutable.MaxWidth
Layoutable.MinHeight
Layoutable.MaxHeight
Layoutable.Margin
Layoutable.HorizontalAlignment
Layoutable.VerticalAlignment
Layoutable.DesiredSize
Layoutable.IsMeasureValid
Layoutable.IsArrangeValid
Layoutable.UseLayoutRounding
Layoutable.EffectiveViewportChanged
Layoutable.LayoutUpdated
Visual.BoundsProperty
Visual.ClipToBoundsProperty
Visual.ClipProperty
Visual.IsVisibleProperty
Visual.OpacityProperty
Visual.OpacityMaskProperty
Visual.CacheModeProperty
Visual.EffectProperty
Visual.HasMirrorTransformProperty
Visual.RenderTransformProperty
Visual.RenderTransformOriginProperty
Visual.FlowDirectionProperty
Visual.VisualParentProperty
Visual.ZIndexProperty
Visual.GetFlowDirection(Visual)
Visual.SetFlowDirection(Visual, FlowDirection)
Visual.InvalidateVisual()
Visual.Render(DrawingContext)
Visual.AffectsRender<T>(params AvaloniaProperty[])
Visual.OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)
Visual.InvalidateMirrorTransform()
Visual.Bounds
Visual.ClipToBounds
Visual.Clip
Visual.IsEffectivelyVisible
Visual.IsVisible
Visual.Opacity
Visual.OpacityMask
Visual.CacheMode
Visual.Effect
Visual.HasMirrorTransform
Visual.RenderTransform
Visual.RenderTransformOrigin
Visual.FlowDirection
Visual.ZIndex
Visual.VisualChildren
Visual.VisualRoot
Visual.BypassFlowDirectionPolicies
Visual.AttachedToVisualTree
Visual.DetachedFromVisualTree
StyledElement.DataContextProperty
StyledElement.NameProperty
StyledElement.ParentProperty
StyledElement.TemplatedParentProperty
StyledElement.ThemeProperty
StyledElement.BeginInit()
StyledElement.EndInit()
StyledElement.ApplyStyling()
StyledElement.InitializeIfNeeded()
StyledElement.OnDataContextBeginUpdate()
StyledElement.OnDataContextEndUpdate()
StyledElement.OnInitialized()
StyledElement.Name
StyledElement.Classes
StyledElement.DataContext
StyledElement.IsInitialized
StyledElement.Styles
StyledElement.StyleKey
StyledElement.Resources
StyledElement.TemplatedParent
StyledElement.Theme
StyledElement.LogicalChildren
StyledElement.PseudoClasses
StyledElement.StyleKeyOverride
StyledElement.Parent
StyledElement.ActualThemeVariant
StyledElement.AttachedToLogicalTree
StyledElement.DetachedFromLogicalTree
StyledElement.DataContextChanged
StyledElement.Initialized
StyledElement.ResourcesChanged
StyledElement.ActualThemeVariantChanged
Animatable.TransitionsProperty
Animatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)
Animatable.Transitions
AvaloniaObject.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.InheritanceParent
AvaloniaObject.this[AvaloniaProperty]
AvaloniaObject.this[IndexerDescriptor]
AvaloniaObject.Dispatcher
AvaloniaObject.PropertyChanged
Extension Methods

Constructors

AppForm()

Constructor

public AppForm()

Fields

fTitleText

The title text of the form.

protected string fTitleText

Field Value

string

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

bool

Context

Gets the form context.

public FormContext Context { get; }

Property Value

FormContext

FormId

A unique id among all pages hosted in the same Avalonia.Controls.TabControl

public string FormId { get; }

Property Value

string

IsClosing

True while closing.

public bool IsClosing { get; }

Property Value

bool

IsFormInitialized

True when initialization is done.

public bool IsFormInitialized { get; protected set; }

Property Value

bool

IsModal

True when this is displayed in a modal dialog

public bool IsModal { get; }

Property Value

bool

IsSelectedForm

True when the ParentTabPage is the selected page in its parent Avalonia.Controls.TabControl

public bool IsSelectedForm { get; }

Property Value

bool

IsSetupDone

True when the setup of this page is done.

public bool IsSetupDone { get; protected set; }

Property Value

bool

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

ModalResult

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

string

Methods

CanCloseForm()

Returns true if this page can close.

public virtual bool CanCloseForm()

Returns

bool

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

Container Control

The 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

EventName string

The broadcaster event name.

Args IDictionary<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

e VisualTreeAttachmentEventArgs

The 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

e KeyEventArgs

The 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

Context FormContext

The 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

Task

TitleTextChanged()

Called when the TitleText property changes.

protected virtual void TitleTextChanged()