Table of Contents

Class LocatorBox

Namespace
Tripous.Desktop
Assembly
Tripous.Desktop.dll

A composite locator editor.

public class LocatorBox : 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
LocatorBox
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.OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)
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

LocatorBox()

Constructor.

public LocatorBox()

Fields

IsReadOnlyProperty

IsReadOnly property.

public static readonly StyledProperty<bool> IsReadOnlyProperty

Field Value

StyledProperty<bool>

KeyValueProperty

KeyValue property.

public static readonly StyledProperty<object> KeyValueProperty

Field Value

StyledProperty<object>

LocatorDefProperty

LocatorDef property.

public static readonly StyledProperty<LocatorDef> LocatorDefProperty

Field Value

StyledProperty<LocatorDef>

fGrid

The popup result grid.

protected GroupGrid fGrid

Field Value

GroupGrid

fLastResult

The last locator result.

protected LocatorResult fLastResult

Field Value

LocatorResult

fMenuButton

The context menu button.

protected Button fMenuButton

Field Value

Button

fPopup

The result popup.

protected Popup fPopup

Field Value

Popup

fPopupBorder

The popup border.

protected Border fPopupBorder

Field Value

Border

fRoot

The root panel.

protected Grid fRoot

Field Value

Grid

fTextBoxMap

The display text boxes by field name.

protected Dictionary<string, TextBox> fTextBoxMap

Field Value

Dictionary<string, TextBox>

fTextBoxes

The display text boxes.

protected List<TextBox> fTextBoxes

Field Value

List<TextBox>

Properties

ContextRowProvider

Provides the current row context.

public IRowProvider ContextRowProvider { get; set; }

Property Value

IRowProvider

IsReadOnly

True when this control is read-only.

public bool IsReadOnly { get; set; }

Property Value

bool

KeyValue

The selected key value.

public object KeyValue { get; set; }

Property Value

object

LocatorDef

The locator definition.

public LocatorDef LocatorDef { get; set; }

Property Value

LocatorDef

MenuButton

The reference menu button.

public Button MenuButton { get; }

Property Value

Button

Methods

ApplyReadOnly()

Applies the read-only state to child editors.

protected virtual void ApplyReadOnly()

AssignRow(DataRow)

Assigns a selected source row.

protected virtual void AssignRow(DataRow Row)

Parameters

Row DataRow

Build()

Builds the visual tree.

protected virtual void Build()

ClearTargetBoxes()

Clears all target textboxes.

public virtual void ClearTargetBoxes()

ClosePopup()

Closes the result popup.

protected virtual void ClosePopup()

ContainsSearchTrigger(string)

Returns true when a term contains the locator search trigger.

protected virtual bool ContainsSearchTrigger(string Term)

Parameters

Term string

Returns

bool

CreateMenuButton()

Creates the context menu button.

protected virtual Button CreateMenuButton()

Returns

Button

CreatePopup()

Creates the popup and result grid.

protected virtual void CreatePopup()

CreatePopupColumns(DataTable)

Creates popup grid columns.

protected virtual void CreatePopupColumns(DataTable Table)

Parameters

Table DataTable

CreateRequest(TextBox)

Creates a locator request.

protected virtual LocatorRequest CreateRequest(TextBox TextBox)

Parameters

TextBox TextBox

Returns

LocatorRequest

CreateTextBox(string)

Creates a field text box.

protected virtual TextBox CreateTextBox(string FieldName)

Parameters

FieldName string

Returns

TextBox

GetDisplayFields()

Returns the locator fields displayed by this control.

protected virtual List<string> GetDisplayFields()

Returns

List<string>

GetFieldWidth(string, int, List<string>)

Returns the display width for a locator field.

protected virtual GridLength GetFieldWidth(string FieldName, int Index, List<string> Fields)

Parameters

FieldName string
Index int
Fields List<string>

Returns

GridLength

GetLogSearchTerm(string)

Returns a normalized search term without the trigger.

protected virtual string GetLogSearchTerm(string Term)

Parameters

Term string

Returns

string

GetPopupGridHeight(DataView)

Returns the popup grid height.

protected virtual double GetPopupGridHeight(DataView DataView)

Parameters

DataView DataView

Returns

double

Grid_DoubleTapped(object, TappedEventArgs)

Handles result grid double tap.

protected virtual void Grid_DoubleTapped(object Sender, TappedEventArgs Args)

Parameters

Sender object
Args TappedEventArgs

Grid_KeyDown(object, KeyEventArgs)

Handles result grid key down.

protected virtual void Grid_KeyDown(object Sender, KeyEventArgs Args)

Parameters

Sender object
Args KeyEventArgs

Grid_PreviewKeyDown(object, KeyEventArgs)

Handles result grid preview key down.

protected virtual void Grid_PreviewKeyDown(object Sender, KeyEventArgs Args)

Parameters

Sender object
Args KeyEventArgs

IsSearchField(string)

Returns true when a field can be used as a search field.

protected virtual bool IsSearchField(string FieldName)

Parameters

FieldName string

Returns

bool

OpenPopup(Control)

Opens the result popup.

protected virtual void OpenPopup(Control Target)

Parameters

Target Control

Rebuild()

Rebuilds the control.

public virtual void Rebuild()

RefreshTargetBoxes(DataRow)

Refreshes all target textboxes from a row.

public virtual void RefreshTargetBoxes(DataRow Row)

Parameters

Row DataRow

RefreshTargetBoxes(DataRow, LocatorMapPlan)

Refreshes all target textboxes from a target row and mapping plan.

public virtual void RefreshTargetBoxes(DataRow Row, LocatorMapPlan Plan)

Parameters

Row DataRow
Plan LocatorMapPlan

Search(TextBox)

Executes locator search.

protected virtual void Search(TextBox TextBox)

Parameters

TextBox TextBox

SelectCurrentRow()

Selects the current popup row.

protected virtual void SelectCurrentRow()

SetTargetBoxValue(string, object)

Sets a textbox value.

public virtual void SetTargetBoxValue(string FieldName, object Value)

Parameters

FieldName string
Value object

TextBox_KeyDown(object, KeyEventArgs)

Handles text box key down.

protected virtual void TextBox_KeyDown(object Sender, KeyEventArgs Args)

Parameters

Sender object
Args KeyEventArgs

TextBox_TextChanged(object, TextChangedEventArgs)

Handles text changes.

protected virtual void TextBox_TextChanged(object Sender, TextChangedEventArgs Args)

Parameters

Sender object
Args TextChangedEventArgs

Events

RowSelected

Occurs when a locator source row is selected or cleared.

public event EventHandler<LocatorBoxRowEventArgs> RowSelected

Event Type

EventHandler<LocatorBoxRowEventArgs>