Table of Contents

Class DataForm

Namespace
Tripous.Desktop
Assembly
Tripous.Desktop.dll

A data form with a List part and an Item part.

All user initiated form actions should enter through Execute(DataFormAction). The ExecuteXXXX() methods are the action handlers and they are the only methods that should directly change, or eventually cause a change to, the FormState.

Low level data operation methods, such as ListSelect(), Insert(), Load(object), Delete(object) and Save(), should be called only by the corresponding ExecuteXXXX() method. This keeps UI commands, keyboard shortcuts and toolbar buttons on the same execution path.

The cancel flow is intentionally split. ExecuteCancel() handles the Cancel action. ExecuteCancelEdit() handles only rejecting item changes. When an item has changes, Cancel asks for confirmation, rejects the changes, refreshes the item controls and stays in the Item part. A second Cancel, with no changes left, returns to the List part.

Startup is the only intentional exception to the general rule. ExecuteStartAction() may call ExecuteEdit(RowId) or ExecuteInsert() directly and delayed through the UI dispatcher. At startup the list part may not be loaded yet, so Execute(Edit) cannot always resolve the desired row through the current list row. This exception is for bootstrapping only; normal UI actions should still use Execute(DataFormAction).

public class DataForm : AppForm, 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
DataForm
Implements
IDataContextProvider
ILogical
IThemeVariantHost
IResourceHost
IResourceNode
IStyleHost
ISetLogicalParent
ISetInheritanceParent
INamed
IInputElement
IDataTemplateHost
ISetterValue
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

DataForm()

Constructor

public DataForm()

Fields

FilterPanelHandler

The SQL filter panel handler.

protected SqlFilterPanelHandler FilterPanelHandler

Field Value

SqlFilterPanelHandler

LastAction

The last executed form action.

protected DataFormAction LastAction

Field Value

DataFormAction

Saving

True while a save operation is in progress.

protected bool Saving

Field Value

bool

SelectListToolBar

The select list toolbar.

protected ToolBar SelectListToolBar

Field Value

ToolBar

ToolBar

The main form toolbar.

protected ToolBar ToolBar

Field Value

ToolBar

btnCancel

The Cancel toolbar button.

protected Button btnCancel

Field Value

Button

btnClose

The Close toolbar button.

protected Button btnClose

Field Value

Button

btnDelete

The Delete toolbar button.

protected Button btnDelete

Field Value

Button

btnEdit

The Edit toolbar button.

protected Button btnEdit

Field Value

Button

btnFind

The Find toolbar button.

protected Button btnFind

Field Value

Button

btnHome

The Home toolbar button.

protected Button btnHome

Field Value

Button

btnInsert

The Insert toolbar button.

protected Button btnInsert

Field Value

Button

btnList

The List toolbar button.

protected Button btnList

Field Value

Button

btnOK

The OK toolbar button.

protected Button btnOK

Field Value

Button

btnRefresh

Reloads the current item from the database.

protected Button btnRefresh

Field Value

Button

btnRefreshList

The Refresh List toolbar button.

protected Button btnRefreshList

Field Value

Button

btnSave

The Save toolbar button.

protected Button btnSave

Field Value

Button

btnToggleIds

The Toggle Ids toolbar button.

protected ToggleButton btnToggleIds

Field Value

ToggleButton

cboSelectList

The select list combo box.

protected ComboBox cboSelectList

Field Value

ComboBox

fFiltersSideBarVisible

True when the filters sidebar is visible.

protected bool fFiltersSideBarVisible

Field Value

bool

fFormState

The current form state.

protected DataFormState fFormState

Field Value

DataFormState

fIdColumnsVisible

True when ID columns are visible.

protected bool fIdColumnsVisible

Field Value

bool

fListTargetId

The list row identifier to select after a list refresh.

protected object fListTargetId

Field Value

object

mnuToggleFactBoxPane

The menu item that toggles the FactBox pane.

protected MenuItem mnuToggleFactBoxPane

Field Value

MenuItem

sepCancelOK

The Cancel/OK toolbar separator.

protected Border sepCancelOK

Field Value

Border

sepEdit

The edit toolbar separator.

protected Border sepEdit

Field Value

Border

sepHome

The Home toolbar separator.

protected Border sepHome

Field Value

Border

sepList

The List toolbar separator.

protected Border sepList

Field Value

Border

sepSave

The Save toolbar separator.

protected Border sepSave

Field Value

Border

Properties

CurrentRow

The current row in the item part

public DataRow CurrentRow { get; }

Property Value

DataRow

DataFormContext

Form context

public DataFormContext DataFormContext { get; }

Property Value

DataFormContext

FiltersSideBarVisible

When true the filters sidebar is visible.

public bool FiltersSideBarVisible { get; set; }

Property Value

bool

FormDef

The form definition.

public FormDef FormDef { get; }

Property Value

FormDef

FormState

The state of a data-form indicates the UI the form is currently displaying

public virtual DataFormState FormState { get; protected set; }

Property Value

DataFormState

IdColumnsVisible

Toggles visibility of list GroupGrid columns ending with ID.

public bool IdColumnsVisible { get; set; }

Property Value

bool

InvalidActions

Form actions the form is not allowed to execute.

This setting comes from the DataFormContext which creates the form.

public DataFormAction InvalidActions { get; }

Property Value

DataFormAction

IsEditableForm

Returns true if this is a form where insert-edit-delete is allowed

public bool IsEditableForm { get; }

Property Value

bool

IsInListState

True when the form is in list state

public virtual bool IsInListState { get; }

Property Value

bool

IsListEmpty

True when the list grid/table is empty.

public bool IsListEmpty { get; }

Property Value

bool

IsReadOnlyForm

Returns true if this is a form where insert-edit-delete is NOT allowed

public bool IsReadOnlyForm { get; }

Property Value

bool

IsSingleSelect

When true then this is a form with a fixed single select.

public bool IsSingleSelect { get; }

Property Value

bool

ItemPage

The item page

public ItemPage ItemPage { get; protected set; }

Property Value

ItemPage

ListCurrentRow

The current row in the list part

public DataRow ListCurrentRow { get; }

Property Value

DataRow

ListIsDirty

True when the list should be reloaded.

public bool ListIsDirty { get; protected set; }

Property Value

bool

Module

The data module

public DataModule Module { get; }

Property Value

DataModule

ModuleDef

The module definition

public ModuleDef ModuleDef { get; }

Property Value

ModuleDef

StartAction

The first action the form should execute after initialization.

public DataFormAction StartAction { get; }

Property Value

DataFormAction

Methods

ApplyIdColumnsVisible()

Applies the visibility of list GroupGrid columns ending with ID.

protected virtual void ApplyIdColumnsVisible()

BindListGrid(SelectDef)

Binds the list grid to the list table data view.

protected virtual void BindListGrid(SelectDef SelectDef)

Parameters

SelectDef SelectDef

The select definition.

CanExecuteGridCommand(GridCommandContext)

Returns true when a detail grid command can execute.

public virtual bool CanExecuteGridCommand(GridCommandContext Context)

Parameters

Context GridCommandContext

The grid command context.

Returns

bool

True if the command can execute; otherwise, false.

CancelChanges()

Cancels changes in the data module.

protected virtual void CancelChanges()

CreateHomeMenu()

Creates the Home button context menu.

protected virtual ContextMenu CreateHomeMenu()

Returns

ContextMenu

The created menu or null.

CreateItemPanel()

Creates the item panel.

protected virtual void CreateItemPanel()

CreateSelectListToolBar()

Creates the select list toolbar.

protected virtual void CreateSelectListToolBar()

CreateToolBar()

Creates the main toolbar.

protected virtual bool CreateToolBar()

Returns

bool

True if the toolbar was created; otherwise, false.

Delete(object)

Deletes an item.

protected virtual void Delete(object oId)

Parameters

oId object

The row identifier.

EnableCommands()

Enables and disables buttons and menu items.

protected virtual void EnableCommands()

EnableControls()

Enables and disables controls.

protected virtual void EnableControls()

Execute(DataFormAction)

Executes a form action.

protected virtual Task Execute(DataFormAction Value)

Parameters

Value DataFormAction

The action to execute.

Returns

Task

ExecuteCancel()

Executes the Cancel action.

protected virtual Task ExecuteCancel()

Returns

Task

ExecuteCancelEdit()

Cancels item editing after optional confirmation.

protected virtual Task<bool> ExecuteCancelEdit()

Returns

Task<bool>

True if editing was cancelled or there were no changes; otherwise, false.

ExecuteCustom(object)

Executes a custom action.

protected virtual Task ExecuteCustom(object Value)

Parameters

Value object

The custom action value.

Returns

Task

ExecuteDelete(object)

Executes the Delete action.

protected virtual Task ExecuteDelete(object oId = null)

Parameters

oId object

The row identifier to delete.

Returns

Task

ExecuteEdit(object)

Executes the Edit action.

protected virtual void ExecuteEdit(object oId = null)

Parameters

oId object

The row identifier to edit.

ExecuteFind()

Executes the Find action.

protected virtual void ExecuteFind()

ExecuteHome()

Executes the Home action.

protected virtual void ExecuteHome()

ExecuteInsert()

Executes the Insert action.

protected virtual void ExecuteInsert()

ExecuteList()

Executes the List action.

protected virtual Task ExecuteList()

Returns

Task

ExecuteRefresh()

Confirms pending changes and reloads the current item from the database.

protected virtual Task ExecuteRefresh()

Returns

Task

ExecuteRefreshList()

Executes the Refresh List action.

protected virtual Task ExecuteRefreshList()

Returns

Task

ExecuteSave()

Executes the Save action.

protected virtual Task ExecuteSave()

Returns

Task

ExecuteShortcut(Button, DataFormAction)

Executes a shortcut action when the associated button is available.

protected virtual bool ExecuteShortcut(Button Button, DataFormAction Action)

Parameters

Button Button

The toolbar button associated with the shortcut.

Action DataFormAction

The form action to execute.

Returns

bool

True if the shortcut was handled; otherwise, false.

ExecuteStartAction()

Executes the startup action.

protected virtual Task ExecuteStartAction()

Returns

Task

ExecuteToggleFactBoxPane()

Toggles the FactBox pane.

protected virtual void ExecuteToggleFactBoxPane()

ExecuteToggleIds()

Executes the Toggle Ids action.

protected virtual void ExecuteToggleIds()

Executed(DataFormAction)

Called after a form action is executed.

protected virtual void Executed(DataFormAction Value)

Parameters

Value DataFormAction

The executed action.

Executing(DataFormAction)

Called before a form action is executed.

protected virtual bool Executing(DataFormAction Value)

Parameters

Value DataFormAction

The action to execute.

Returns

bool

True to cancel the default execution; otherwise, false.

FindFirstFocusableControl(Control)

Returns the first editable focus control in a container.

protected override Control FindFirstFocusableControl(Control Container)

Parameters

Container Control

The container to search.

Returns

Control

The first editable focus control, if any; otherwise, null.

FocusPreviousEditableControl(Control)

Focuses the previous editable control in the item panel.

public virtual bool FocusPreviousEditableControl(Control Current)

Parameters

Current Control

The current control.

Returns

bool

True if focus moved; otherwise, false.

FormStateChanged()

Called when the FormState property changes.

protected virtual void FormStateChanged()

GetCurrentListId()

Returns the current list row identifier.

protected virtual object GetCurrentListId()

Returns

object

The current list row identifier, if any; otherwise, null.

GetItemLogText(object)

Returns a text describing the current item for logging purposes.

protected virtual string GetItemLogText(object Id)

Parameters

Id object

The item identifier.

Returns

string

The item log text.

GetSavedFilterValues(SelectDef, SqlFilterDefs)

Creates and returns a new SqlFilterDefs instance with the saved filter values of the current user.

protected virtual SqlFilterDefs GetSavedFilterValues(SelectDef SelectDef, SqlFilterDefs FilterDefs)

Parameters

SelectDef SelectDef

The select definition.

FilterDefs SqlFilterDefs

The filter definitions.

Returns

SqlFilterDefs

The filter definitions with saved values applied.

GoToListOID(object)

Selects a list row by identifier.

protected virtual bool GoToListOID(object oId)

Parameters

oId object

The row identifier.

Returns

bool

True if the row was found and selected; otherwise, false.

HasChanges()

Returns true when the data module has changes.

protected virtual bool HasChanges()

Returns

bool

True if the data module has changes; otherwise, false.

HasVisibleFactBoxes()

Returns true when the form can display a FactBox pane.

protected virtual bool HasVisibleFactBoxes()

Returns

bool

True when a FactBox pane can be displayed.

HomeMenu_Opening(object, CancelEventArgs)

Handles the Home menu opening event.

protected virtual void HomeMenu_Opening(object Sender, CancelEventArgs Args)

Parameters

Sender object

The event sender.

Args CancelEventArgs

The event arguments.

InitializeComponent(bool)

Wires up the controls and optionally loads XAML markup and attaches dev tools (if Avalonia.Diagnostics package is referenced).

[ExcludeFromCodeCoverage]
public void InitializeComponent(bool loadXaml = true)

Parameters

loadXaml bool

Should the XAML be loaded into the component.

Insert()

Inserts a new item.

protected virtual void Insert()

IsEditableFocusControl(Control)

Returns true when a control can receive edit focus.

protected virtual bool IsEditableFocusControl(Control Control)

Parameters

Control Control

The control to check.

Returns

bool

True if the control can receive edit focus; otherwise, false.

ListSelect()

Selects the current list using the selected select definition and active filters.

protected virtual Task ListSelect()

Returns

Task

Load(object)

Loads an item for editing.

protected virtual void Load(object oId)

Parameters

oId object

The row identifier.

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 modal result data back to the form context.

protected override 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 override bool ProcessEscapeKey()

Returns

bool

True if the escape key was processed; otherwise, false.

ProcessKeyDown(KeyEventArgs)

Processes key down events.

protected override bool ProcessKeyDown(KeyEventArgs e)

Parameters

e KeyEventArgs

The key event arguments.

Returns

bool

True if the key was processed; otherwise, false.

ProcessShortcutKey(KeyEventArgs)

Processes a keyboard shortcut.

protected virtual bool ProcessShortcutKey(KeyEventArgs e)

Parameters

e KeyEventArgs

The key event arguments.

Returns

bool

True if the shortcut was handled; otherwise, false.

Refresh()

Reloads the current item and refreshes its controls.

protected virtual void Refresh()

Save()

Saves the current item.

protected virtual void Save()

SelectedSelectChanged()

Called when another named SELECT is selected in the combobox with the select list.

protected virtual void SelectedSelectChanged()

Start()

Executes any first command on the form

protected override Task Start()

Returns

Task

UiLog(string)

Writes a message to the UI log when data form logging is enabled.

protected virtual void UiLog(string Message)

Parameters

Message string

The message to write.

UnBindListGrid()

Unbinds the list grid.

protected virtual void UnBindListGrid()

UpdateHomeMenuItems()

Updates the Home menu item states.

protected virtual void UpdateHomeMenuItems()

UpdateUi()

Updates the user interface, title, enable-disable buttons etc.

public virtual void UpdateUi()