Table of Contents

Class RDFormsFileListBox

Namespace
RDCore.Forms.Avalonia.Controls
Assembly
RDCore.Forms.Avalonia.dll

A VB FileListBox: a Avalonia.Controls.ListBox that shows a FileListBox component, the files of a folder.

public sealed class RDFormsFileListBox : ListBox, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, INamed, IInputElement, IDataTemplateHost, ISetterValue, IChildIndexProvider
Inheritance
AvaloniaObject
Animatable
StyledElement
Visual
Layoutable
Interactive
InputElement
Control
TemplatedControl
ItemsControl
SelectingItemsControl
ListBox
RDFormsFileListBox
Implements
IDataContextProvider
ILogical
IThemeVariantHost
IResourceHost
IResourceNode
IStyleHost
ISetLogicalParent
ISetInheritanceParent
INamed
IInputElement
IDataTemplateHost
ISetterValue
IChildIndexProvider
Inherited Members
ListBox.ScrollProperty
ListBox.SelectedItemsProperty
ListBox.SelectionProperty
ListBox.SelectionModeProperty
ListBox.SelectAll()
ListBox.UnselectAll()
ListBox.Scroll
ListBox.SelectedItems
ListBox.Selection
ListBox.SelectionMode
SelectingItemsControl.AutoScrollToSelectedItemProperty
SelectingItemsControl.SelectedIndexProperty
SelectingItemsControl.SelectedItemProperty
SelectingItemsControl.SelectedValueProperty
SelectingItemsControl.SelectedValueBindingProperty
SelectingItemsControl.IsSelectedProperty
SelectingItemsControl.IsTextSearchEnabledProperty
SelectingItemsControl.IsSelectedChangedEvent
SelectingItemsControl.SelectionChangedEvent
SelectingItemsControl.WrapSelectionProperty
SelectingItemsControl.BeginInit()
SelectingItemsControl.EndInit()
SelectingItemsControl.GetIsSelected(Control)
SelectingItemsControl.ItemsControlFromItemContainer(Control)
SelectingItemsControl.UpdateSelectionFromEvent(Control, RoutedEventArgs)
SelectingItemsControl.AutoScrollToSelectedItem
SelectingItemsControl.SelectedIndex
SelectingItemsControl.SelectedItem
SelectingItemsControl.SelectedValueBinding
SelectingItemsControl.SelectedValue
SelectingItemsControl.IsTextSearchEnabled
SelectingItemsControl.WrapSelection
SelectingItemsControl.SelectionChanged
ItemsControl.ItemContainerThemeProperty
ItemsControl.ItemCountProperty
ItemsControl.ItemsPanelProperty
ItemsControl.ItemsSourceProperty
ItemsControl.ItemTemplateProperty
ItemsControl.DisplayMemberBindingProperty
ItemsControl.IndexFromContainer(Control)
ItemsControl.ItemFromContainer(Control)
ItemsControl.GetRealizedContainers()
ItemsControl.DisplayMemberBinding
ItemsControl.ItemContainerGenerator
ItemsControl.Items
ItemsControl.ItemContainerTheme
ItemsControl.ItemCount
ItemsControl.ItemsPanel
ItemsControl.ItemsSource
ItemsControl.ItemTemplate
ItemsControl.Presenter
ItemsControl.ItemsPanelRoot
ItemsControl.ItemsView
ItemsControl.PreparingContainer
ItemsControl.ContainerPrepared
ItemsControl.ContainerIndexChanged
ItemsControl.ContainerClearing
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.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.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.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.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)
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.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.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.AttachedToVisualTree
Visual.DetachedFromVisualTree
StyledElement.DataContextProperty
StyledElement.NameProperty
StyledElement.ParentProperty
StyledElement.TemplatedParentProperty
StyledElement.ThemeProperty
StyledElement.ApplyStyling()
StyledElement.Name
StyledElement.Classes
StyledElement.DataContext
StyledElement.IsInitialized
StyledElement.Styles
StyledElement.StyleKey
StyledElement.Resources
StyledElement.TemplatedParent
StyledElement.Theme
StyledElement.Parent
StyledElement.ActualThemeVariant
StyledElement.AttachedToLogicalTree
StyledElement.DetachedFromLogicalTree
StyledElement.DataContextChanged
StyledElement.Initialized
StyledElement.ResourcesChanged
StyledElement.ActualThemeVariantChanged
Animatable.TransitionsProperty
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.this[AvaloniaProperty]
AvaloniaObject.this[IndexerDescriptor]
AvaloniaObject.Dispatcher
AvaloniaObject.PropertyChanged

Remarks

Its items are the names of the files in Path that match the component's Pattern, as the names are on disk, sorted without regard to case. A hidden file is listed only where Hidden is True, and a system file only where System is True; Archive, Normal and ReadOnly leave the list as it is, as measured with VB6. The list is read again when Path, Pattern, Hidden or System changes and on Refresh(); a file made or removed on disk shows only then.

Pattern holds one or more patterns separated by semicolons, such as *.txt;*.bas, and a file that matches any of them is listed. * stands for any characters and ? for one, without regard to case, and a pattern that ends with .* also matches a name with no extension. A change of Pattern raises PatternChange.

With a MultiSelect of Simple or Extended, it selects files as a RDFormsListBox with that MultiSelect does: ListIndex is the file with the focus, the first one each time the files are listed, and the selection is a set of files apart from it. FileName is the file with the focus, selected or not.

It raises Click, DblClick, GotFocus, LostFocus, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove, MouseUp, PathChange and PatternChange. A press, a key or a typed character raises Click as a ListBox's does.

Constructors

RDFormsFileListBox(ComponentInstance, IFileSystem)

Creates a list that shows a FileListBox.

public RDFormsFileListBox(ComponentInstance instance, IFileSystem fileSystem)

Parameters

instance ComponentInstance

The FileListBox.

fileSystem IFileSystem

The file system it lists the files of. Its current directory is the list's first Path.

Remarks

It follows its MultiSelect set later, from code, as a RDFormsListBox does, keeping its files.

Exceptions

ArgumentNullException

instance or fileSystem is null.

ArgumentException

instance is not a FileListBox.

Properties

FileName

The selected file's name, or on a multi-select list the focused one's; "" where there is none.

public string FileName { get; set; }

Property Value

string

Remarks

Setting a file's name makes it the Pattern, which lists that file alone, and selects it, or on a multi-select list gives it the focus; it reads back as the name is on disk. Setting a pattern, one with * or ?, makes it the Pattern and selects nothing. A name or a pattern with a folder sets Path to that folder first.

It raises PathChange where the folder changes and PatternChange where the Pattern does, and no Click. A file's name then raises DblClick; the same file again raises nothing. Where only the folder changes, the DblClick is RDForms' own.

Exceptions

FormErrorException

Set to a file that does not exist: 53, File not found. Set in a folder that does not exist: 76, Path not found.

ListCount

The number of files listed.

public int ListCount { get; }

Property Value

int

ListIndex

The selected file, -1 for none; on a multi-select list, the focused file, 0 where there is none.

public int ListIndex { get; set; }

Property Value

int

Remarks

Setting it raises Click when it moves the selection, and none when it is set again. On a multi-select list, -1 raises Click and changes nothing, and the focused file does nothing.

Exceptions

FormErrorException

Set outside -1 to ListCount - 1: 381, Invalid property array index. On a multi-select list, set to anything but -1 and the focused file: 381.

Path

The folder whose files are listed, without a separator at its end.

public string Path { get; set; }

Property Value

string

Remarks

A relative path is taken from the list's own Path. Setting a new folder lists its files, leaves no file selected, and raises PathChange; setting the same one again raises nothing.

Exceptions

FormErrorException

Set to a folder that does not exist: 76, Path not found.

Pattern

The component's Pattern: the patterns a file's name must match to be listed.

public string Pattern { get; set; }

Property Value

string

Remarks

Setting it lists the files again, and raises PatternChange where it changes.

StyleKeyOverride

Gets the type by which the element is styled.

protected override Type StyleKeyOverride { get; }

Property Value

Type

Remarks

Usually controls are styled by their own type, but there are instances where you want an element to be styled by its base type, e.g. creating SpecialButton that derives from Button and adds extra functionality but is still styled as a regular Button. Override this property to change the style for a control class, returning the type that you wish the elements to be styled as.

Methods

CreateContainerForItemOverride(object?, int, object?)

Creates or a container that can be used to display an item.

protected override Control CreateContainerForItemOverride(object? item, int index, object? recycleKey)

Parameters

item object
index int
recycleKey object

Returns

Control

GetList(int)

Gets a file's name.

public string GetList(int index)

Parameters

index int

The file's index, from 0.

Returns

string

The file's name, or "" for an index outside the list.

GetSelected(int)

Gets whether a file is selected.

public bool GetSelected(int index)

Parameters

index int

The file's index, from 0.

Returns

bool

Whether it is selected.

Exceptions

FormErrorException

index is outside the files: 381, Invalid property array index.

OnKeyDown(KeyEventArgs)

Handles directional navigation within the Avalonia.Controls.ItemsControl.

protected override void OnKeyDown(KeyEventArgs e)

Parameters

e KeyEventArgs

The key events.

OnTextInput(TextInputEventArgs)

Invoked when an unhandled Avalonia.Input.InputElement.TextInputEvent reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

protected override void OnTextInput(TextInputEventArgs e)

Parameters

e TextInputEventArgs

Data about the event.

Refresh()

Reads the files of Path again, and leaves no file selected.

public void Refresh()

SetSelected(int, bool)

Selects or clears a file, and raises Click when that changes something.

public void SetSelected(int index, bool selected)

Parameters

index int

The file's index, from 0.

selected bool

Whether to select it.

Remarks

On a single-select list it moves the selection, and clearing the selected file leaves none. On a multi-select one, selecting a file adds it and moves the focus to it, and clearing it removes it and leaves the focus.

Exceptions

FormErrorException

index is outside the files: 381, Invalid property array index.