Class RDFormsDriveListBox
A VB DriveListBox: a Avalonia.Controls.ComboBox that shows a DriveListBox component, the drives of a file system.
public sealed class RDFormsDriveListBox : ComboBox, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, INamed, IInputElement, IDataTemplateHost, ISetterValue, IChildIndexProvider
- Inheritance
-
AvaloniaObjectAnimatableStyledElementVisualLayoutableInteractiveInputElementControlTemplatedControlItemsControlSelectingItemsControlComboBoxRDFormsDriveListBox
- Implements
-
IDataContextProviderILogicalIThemeVariantHostIResourceHostIResourceNodeIStyleHostISetLogicalParentISetInheritanceParentINamedIInputElementIDataTemplateHostISetterValueIChildIndexProvider
- Inherited Members
-
ComboBox.IsDropDownOpenPropertyComboBox.IsEditablePropertyComboBox.MaxDropDownHeightPropertyComboBox.SelectionBoxItemPropertyComboBox.PlaceholderTextPropertyComboBox.PlaceholderForegroundPropertyComboBox.HorizontalContentAlignmentPropertyComboBox.VerticalContentAlignmentPropertyComboBox.TextPropertyComboBox.SelectionBoxItemTemplatePropertyComboBox.UpdateSelectionFromEvent(Control, RoutedEventArgs)ComboBox.Clear()ComboBox.IsDropDownOpenComboBox.IsEditableComboBox.MaxDropDownHeightComboBox.SelectionBoxItemComboBox.PlaceholderTextComboBox.PlaceholderForegroundComboBox.HorizontalContentAlignmentComboBox.VerticalContentAlignmentComboBox.SelectionBoxItemTemplateComboBox.TextComboBox.DropDownClosedComboBox.DropDownOpenedSelectingItemsControl.AutoScrollToSelectedItemPropertySelectingItemsControl.SelectedIndexPropertySelectingItemsControl.SelectedItemPropertySelectingItemsControl.SelectedValuePropertySelectingItemsControl.SelectedValueBindingPropertySelectingItemsControl.IsSelectedPropertySelectingItemsControl.IsTextSearchEnabledPropertySelectingItemsControl.IsSelectedChangedEventSelectingItemsControl.SelectionChangedEventSelectingItemsControl.WrapSelectionPropertySelectingItemsControl.BeginInit()SelectingItemsControl.EndInit()SelectingItemsControl.GetIsSelected(Control)SelectingItemsControl.ItemsControlFromItemContainer(Control)SelectingItemsControl.AutoScrollToSelectedItemSelectingItemsControl.SelectedIndexSelectingItemsControl.SelectedItemSelectingItemsControl.SelectedValueBindingSelectingItemsControl.SelectedValueSelectingItemsControl.IsTextSearchEnabledSelectingItemsControl.WrapSelectionSelectingItemsControl.SelectionChangedItemsControl.ItemContainerThemePropertyItemsControl.ItemCountPropertyItemsControl.ItemsPanelPropertyItemsControl.ItemsSourcePropertyItemsControl.ItemTemplatePropertyItemsControl.DisplayMemberBindingPropertyItemsControl.IndexFromContainer(Control)ItemsControl.ItemFromContainer(Control)ItemsControl.GetRealizedContainers()ItemsControl.DisplayMemberBindingItemsControl.ItemContainerGeneratorItemsControl.ItemsItemsControl.ItemContainerThemeItemsControl.ItemCountItemsControl.ItemsPanelItemsControl.ItemsSourceItemsControl.ItemTemplateItemsControl.PresenterItemsControl.ItemsPanelRootItemsControl.ItemsViewItemsControl.PreparingContainerItemsControl.ContainerPreparedItemsControl.ContainerIndexChangedItemsControl.ContainerClearingTemplatedControl.BackgroundPropertyTemplatedControl.BackgroundSizingPropertyTemplatedControl.BorderBrushPropertyTemplatedControl.BorderThicknessPropertyTemplatedControl.CornerRadiusPropertyTemplatedControl.FontFamilyPropertyTemplatedControl.FontFeaturesPropertyTemplatedControl.FontSizePropertyTemplatedControl.FontStylePropertyTemplatedControl.FontWeightPropertyTemplatedControl.FontStretchPropertyTemplatedControl.ForegroundPropertyTemplatedControl.LetterSpacingPropertyTemplatedControl.PaddingPropertyTemplatedControl.TemplatePropertyTemplatedControl.IsTemplateFocusTargetPropertyTemplatedControl.TemplateAppliedEventTemplatedControl.GetIsTemplateFocusTarget(Control)TemplatedControl.ApplyTemplate()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.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.GetIsHoldingEnabled(StyledElement)InputElement.GetIsHoldWithMouseEnabled(StyledElement)InputElement.FocusableInputElement.IsEnabledInputElement.CursorInputElement.IsKeyboardFocusWithinInputElement.IsFocusedInputElement.IsHitTestVisibleInputElement.IsPointerOverInputElement.IsTabStopInputElement.IsEffectivelyEnabledInputElement.TabIndexInputElement.KeyBindingsInputElement.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)Layoutable.DesiredSizePropertyLayoutable.WidthPropertyLayoutable.HeightPropertyLayoutable.MinWidthPropertyLayoutable.MaxWidthPropertyLayoutable.MinHeightPropertyLayoutable.MaxHeightPropertyLayoutable.MarginPropertyLayoutable.HorizontalAlignmentPropertyLayoutable.VerticalAlignmentPropertyLayoutable.UseLayoutRoundingPropertyLayoutable.UpdateLayout()Layoutable.Measure(Size)Layoutable.Arrange(Rect)Layoutable.InvalidateMeasure()Layoutable.InvalidateArrange()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.BoundsVisual.ClipToBoundsVisual.ClipVisual.IsEffectivelyVisibleVisual.IsVisibleVisual.OpacityVisual.OpacityMaskVisual.CacheModeVisual.EffectVisual.HasMirrorTransformVisual.RenderTransformVisual.RenderTransformOriginVisual.FlowDirectionVisual.ZIndexVisual.AttachedToVisualTreeVisual.DetachedFromVisualTreeStyledElement.DataContextPropertyStyledElement.NamePropertyStyledElement.ParentPropertyStyledElement.TemplatedParentPropertyStyledElement.ThemePropertyStyledElement.ApplyStyling()StyledElement.NameStyledElement.ClassesStyledElement.DataContextStyledElement.IsInitializedStyledElement.StylesStyledElement.StyleKeyStyledElement.ResourcesStyledElement.TemplatedParentStyledElement.ThemeStyledElement.ParentStyledElement.ActualThemeVariantStyledElement.AttachedToLogicalTreeStyledElement.DetachedFromLogicalTreeStyledElement.DataContextChangedStyledElement.InitializedStyledElement.ResourcesChangedStyledElement.ActualThemeVariantChangedAnimatable.TransitionsPropertyAnimatable.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.this[AvaloniaProperty]AvaloniaObject.this[IndexerDescriptor]AvaloniaObject.DispatcherAvaloniaObject.PropertyChanged
Remarks
A drive with a letter shows as the letter in lower case and a colon, then its volume label in brackets where it has one, such as
c: [Windows]. A drive without a letter, as on Linux and macOS, shows as its root's path, such as /.
It raises Change, GotFocus, LostFocus, KeyDown, KeyPress and KeyUp, and no Click and no mouse events. Change comes whenever another drive, or none, is chosen, by the user or by code.
Constructors
RDFormsDriveListBox(ComponentInstance, IFileSystem)
Creates a list that shows a DriveListBox.
public RDFormsDriveListBox(ComponentInstance instance, IFileSystem fileSystem)
Parameters
instanceComponentInstanceThe DriveListBox.
fileSystemIFileSystemThe file system it lists the drives of. The drive of its current directory is the first one chosen.
Exceptions
- ArgumentNullException
instanceorfileSystemis null.- ArgumentException
instanceis not a DriveListBox.
Properties
Drive
The chosen drive, as it shows, such as c: [Windows], or "" where none is chosen.
public string Drive { get; set; }
Property Value
Remarks
It is set to a drive's letter, alone or followed by a colon and anything, such as c, c:, c: [Windows] or
C:\Windows, or, for a drive without a letter, to a path on it. Setting another drive raises Change; setting the chosen one again raises nothing.
Exceptions
- FormErrorException
Set to "": 380, Invalid property value. Set to no drive of the list: 68, Device unavailable.
ListCount
The number of drives.
public int ListCount { get; }
Property Value
ListIndex
The chosen drive's index, from 0, or -1 where none is chosen.
public int ListIndex { get; set; }
Property Value
Remarks
Setting it chooses that drive, or none for -1, and raises Change where that is another.
Exceptions
- FormErrorException
Set outside -1 to ListCount - 1: 381, Invalid property array index.
StyleKeyOverride
Gets the type by which the element is styled.
protected override Type StyleKeyOverride { get; }
Property Value
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
GetList(int)
Gets a drive as it shows.
public string GetList(int index)
Parameters
indexintThe drive's index, from 0.
Returns
- string
The drive, or "" for an index outside the list.
OnApplyTemplate(TemplateAppliedEventArgs)
Called when the control's template is applied. In simple terms, this means the method is called just before the control is displayed.
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
Parameters
eTemplateAppliedEventArgsThe event args.
OnCreateAutomationPeer()
Returns a new, type-specific Avalonia.Automation.Peers.AutomationPeer implementation for the control.
protected override AutomationPeer OnCreateAutomationPeer()
Returns
- AutomationPeer
The type-specific Avalonia.Automation.Peers.AutomationPeer implementation.
OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
Called when a avalonia property changes on the object.
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
Parameters
changeAvaloniaPropertyChangedEventArgsThe property change details.
PrepareContainerForItemOverride(Control, object?, int)
Prepares the specified element to display the specified item.
protected override void PrepareContainerForItemOverride(Control container, object? item, int index)
Parameters
containerControlThe element that's used to display the specified item.
itemobjectThe item to display.
indexintThe index of the item to display.
Refresh()
Reads the drives again, and keeps the chosen one where it is still there; otherwise chooses the first, and raises Change.
public void Refresh()