Class DataForm
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
-
AvaloniaObjectAnimatableStyledElementVisualLayoutableInteractiveInputElementControlTemplatedControlContentControlUserControlDataForm
- Implements
-
IDataContextProviderILogicalIThemeVariantHostIResourceHostIResourceNodeIStyleHostISetLogicalParentISetInheritanceParentINamedIInputElementIDataTemplateHostISetterValue
- 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
DataForm()
Constructor
public DataForm()
Fields
FilterPanelHandler
The SQL filter panel handler.
protected SqlFilterPanelHandler FilterPanelHandler
Field Value
LastAction
The last executed form action.
protected DataFormAction LastAction
Field Value
Saving
True while a save operation is in progress.
protected bool Saving
Field Value
SelectListToolBar
The select list toolbar.
protected ToolBar SelectListToolBar
Field Value
ToolBar
The main form toolbar.
protected ToolBar ToolBar
Field Value
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
fFormState
The current form state.
protected DataFormState fFormState
Field Value
fIdColumnsVisible
True when ID columns are visible.
protected bool fIdColumnsVisible
Field Value
fListTargetId
The list row identifier to select after a list refresh.
protected object fListTargetId
Field Value
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
DataFormContext
Form context
public DataFormContext DataFormContext { get; }
Property Value
FiltersSideBarVisible
When true the filters sidebar is visible.
public bool FiltersSideBarVisible { get; set; }
Property Value
FormDef
The form definition.
public FormDef FormDef { get; }
Property Value
FormState
The state of a data-form indicates the UI the form is currently displaying
public virtual DataFormState FormState { get; protected set; }
Property Value
IdColumnsVisible
Toggles visibility of list GroupGrid columns ending with ID.
public bool IdColumnsVisible { get; set; }
Property Value
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
IsEditableForm
Returns true if this is a form where insert-edit-delete is allowed
public bool IsEditableForm { get; }
Property Value
IsInListState
True when the form is in list state
public virtual bool IsInListState { get; }
Property Value
IsListEmpty
True when the list grid/table is empty.
public bool IsListEmpty { get; }
Property Value
IsReadOnlyForm
Returns true if this is a form where insert-edit-delete is NOT allowed
public bool IsReadOnlyForm { get; }
Property Value
IsSingleSelect
When true then this is a form with a fixed single select.
public bool IsSingleSelect { get; }
Property Value
ItemPage
The item page
public ItemPage ItemPage { get; protected set; }
Property Value
ListCurrentRow
The current row in the list part
public DataRow ListCurrentRow { get; }
Property Value
ListIsDirty
True when the list should be reloaded.
public bool ListIsDirty { get; protected set; }
Property Value
Module
The data module
public DataModule Module { get; }
Property Value
ModuleDef
The module definition
public ModuleDef ModuleDef { get; }
Property Value
StartAction
The first action the form should execute after initialization.
public DataFormAction StartAction { get; }
Property Value
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
SelectDefSelectDefThe select definition.
CanExecuteGridCommand(GridCommandContext)
Returns true when a detail grid command can execute.
public virtual bool CanExecuteGridCommand(GridCommandContext Context)
Parameters
ContextGridCommandContextThe 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
oIdobjectThe 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
ValueDataFormActionThe action to execute.
Returns
ExecuteCancel()
Executes the Cancel action.
protected virtual Task ExecuteCancel()
Returns
ExecuteCancelEdit()
Cancels item editing after optional confirmation.
protected virtual Task<bool> ExecuteCancelEdit()
Returns
ExecuteCustom(object)
Executes a custom action.
protected virtual Task ExecuteCustom(object Value)
Parameters
ValueobjectThe custom action value.
Returns
ExecuteDelete(object)
Executes the Delete action.
protected virtual Task ExecuteDelete(object oId = null)
Parameters
oIdobjectThe row identifier to delete.
Returns
ExecuteEdit(object)
Executes the Edit action.
protected virtual void ExecuteEdit(object oId = null)
Parameters
oIdobjectThe 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
ExecuteRefresh()
Confirms pending changes and reloads the current item from the database.
protected virtual Task ExecuteRefresh()
Returns
ExecuteRefreshList()
Executes the Refresh List action.
protected virtual Task ExecuteRefreshList()
Returns
ExecuteSave()
Executes the Save action.
protected virtual Task ExecuteSave()
Returns
ExecuteShortcut(Button, DataFormAction)
Executes a shortcut action when the associated button is available.
protected virtual bool ExecuteShortcut(Button Button, DataFormAction Action)
Parameters
ButtonButtonThe toolbar button associated with the shortcut.
ActionDataFormActionThe form action to execute.
Returns
- bool
True if the shortcut was handled; otherwise, false.
ExecuteStartAction()
Executes the startup action.
protected virtual Task ExecuteStartAction()
Returns
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
ValueDataFormActionThe executed action.
Executing(DataFormAction)
Called before a form action is executed.
protected virtual bool Executing(DataFormAction Value)
Parameters
ValueDataFormActionThe 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
ContainerControlThe 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
CurrentControlThe 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
IdobjectThe 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
SelectDefSelectDefThe select definition.
FilterDefsSqlFilterDefsThe 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
oIdobjectThe 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
SenderobjectThe event sender.
ArgsCancelEventArgsThe 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
loadXamlboolShould 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
ControlControlThe 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
Load(object)
Loads an item for editing.
protected virtual void Load(object oId)
Parameters
oIdobjectThe row identifier.
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 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
eKeyEventArgsThe 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
eKeyEventArgsThe 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
UiLog(string)
Writes a message to the UI log when data form logging is enabled.
protected virtual void UiLog(string Message)
Parameters
MessagestringThe 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()