In This Article

StandardSwitcher Class

Implements a SwitcherBase that is similar to the switcher found in Visual Studio.

[TemplatePart(Name = "PART_ItemsPanel", Type = typeof(Grid))]
public class StandardSwitcher : SwitcherBase, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue
Inheritance:
object AvaloniaObject Animatable StyledElement Visual Layoutable Interactive InputElement Control TemplatedControl SwitcherBase object
Implements:
IDataContextProvider ILogical IThemeVariantHost IResourceHost IResourceNode IStyleHost ISetLogicalParent ISetInheritanceParent IStyleable INamed IInputElement IDataTemplateHost ISetterValue

Constructors

StandardSwitcher()

Initializes an instance of the class.

public StandardSwitcher()

Properties

AreDocumentsVisible

Whether the documents are visible in the switcher.

public bool AreDocumentsVisible { get; set; }

Property Value

bool:

true if the documents are visible in the switcher; otherwise false. The default value is true.

AreToolWindowsVisible

Whether the tool windows are visible in the switcher.

public bool AreToolWindowsVisible { get; set; }

Property Value

bool:

true if the tool windows are visible in the switcher; otherwise false. The default value is true.

DocumentsColumnTitle

The text to use for the documents column title.

public string? DocumentsColumnTitle { get; set; }

Property Value

string

Elevation

The elevation of the shadow, a value from 0 to 24.

public int Elevation { get; set; }

Property Value

int:

The default value is 4.

Remarks

Higher elevations render larger shadows. 0 doesn't render a shadow.

FooterTemplate

The Avalonia.Controls.Templates.IDataTemplate to use for the footer area of the switcher, whose content is the SelectedWindow.

public IDataTemplate? FooterTemplate { get; set; }

Property Value

IDataTemplate

HeaderTemplate

The Avalonia.Controls.Templates.IDataTemplate to use for the header area of the switcher, whose content is the SelectedWindow.

public IDataTemplate? HeaderTemplate { get; set; }

Property Value

IDataTemplate

IsShadowEnabled

Whether the shadow can be rendered by the chrome.

public bool IsShadowEnabled { get; set; }

Property Value

bool:

The default value is true.

Remarks

Set this property to false to prevent the shadow from rendering.

ItemContainerTheme

The Avalonia.Styling.ControlTheme to use for rendering items.

public ControlTheme? ItemContainerTheme { get; set; }

Property Value

ControlTheme

ItemTemplate

The Avalonia.Controls.Templates.IDataTemplate to use for rendering items.

public IDataTemplate? ItemTemplate { get; set; }

Property Value

IDataTemplate

MaxDocumentColumnCount

The maximum number of document columns to display.

public int MaxDocumentColumnCount { get; set; }

Property Value

int:

The default value is 3.

MaxRowCount

The maximum number of item rows that can be displayed.

public int MaxRowCount { get; set; }

Property Value

int:

The default value is 15.

ScrollButtonTheme

The Avalonia.Styling.ControlTheme to use for a scroll button.

public ControlTheme? ScrollButtonTheme { get; set; }

Property Value

ControlTheme

ScrollDownButtonContentTemplate

The Avalonia.Controls.Templates.IDataTemplate to use for the scroll down button content.

public IDataTemplate? ScrollDownButtonContentTemplate { get; set; }

Property Value

IDataTemplate

ScrollUpButtonContentTemplate

The Avalonia.Controls.Templates.IDataTemplate to use for the scroll up button content.

public IDataTemplate? ScrollUpButtonContentTemplate { get; set; }

Property Value

IDataTemplate

ShadowColor

The shadow's color, which should be an opaque color.

public Color ShadowColor { get; set; }

Property Value

Color:

The default value is Black.

Remarks

This property is mixed with the ShadowOpacity to obtain the resolved semi-transparent color.

ShadowOpacity

The shadow's opacity, which is a percentage value in the range 0.0..1.0.

public double ShadowOpacity { get; set; }

Property Value

double:

The default value is 0.3.

Remarks

Lower property values will provide a softer shadow.

ToolWindowsColumnTitle

The text to use for the tool windows column title.

public string? ToolWindowsColumnTitle { get; set; }

Property Value

string

Methods

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)
Parameter Type Description
e TemplateAppliedEventArgs

The event args.

OnClosed()

Invoked when the switcher is closed.

protected override void OnClosed()

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.

OnKeyDown(KeyEventArgs)

Called before the Avalonia.Input.InputElement.KeyDown event occurs.

protected override void OnKeyDown(KeyEventArgs e)
Parameter Type Description
e KeyEventArgs

The event args.

OnOpened()

Invoked when the switcher is opened.

protected override void OnOpened()

OnSelectedWindowChanged(DockingWindow?, DockingWindow?)

Occurs when the SelectedWindow property is changed.

protected override void OnSelectedWindowChanged(DockingWindow? oldValue, DockingWindow? newValue)
Parameter Type Description
oldValue DockingWindow

The old value.

newValue DockingWindow

The new value.

Fields

AreDocumentsVisibleProperty

Defines the AreDocumentsVisible property.

public static readonly StyledProperty<bool> AreDocumentsVisibleProperty

AreToolWindowsVisibleProperty

Defines the AreToolWindowsVisible property.

public static readonly StyledProperty<bool> AreToolWindowsVisibleProperty

DocumentsColumnTitleProperty

Defines the DocumentsColumnTitle property.

public static readonly StyledProperty<string?> DocumentsColumnTitleProperty

ElevationProperty

Defines the Elevation property.

public static readonly StyledProperty<int> ElevationProperty

FooterTemplateProperty

Defines the FooterTemplate property.

public static readonly StyledProperty<IDataTemplate?> FooterTemplateProperty

HeaderTemplateProperty

Defines the HeaderTemplate property.

public static readonly StyledProperty<IDataTemplate?> HeaderTemplateProperty

IsShadowEnabledProperty

Defines the IsShadowEnabled property.

public static readonly StyledProperty<bool> IsShadowEnabledProperty

ItemContainerThemeProperty

Defines the ItemContainerTheme property.

public static readonly StyledProperty<ControlTheme?> ItemContainerThemeProperty

ItemTemplateProperty

Defines the ItemTemplate property.

public static readonly StyledProperty<IDataTemplate?> ItemTemplateProperty

MaxDocumentColumnCountProperty

Defines the MaxDocumentColumnCount property.

public static readonly StyledProperty<int> MaxDocumentColumnCountProperty

MaxRowCountProperty

Defines the MaxRowCount property.

public static readonly StyledProperty<int> MaxRowCountProperty

ScrollButtonThemeProperty

Defines the ScrollButtonTheme property.

public static readonly StyledProperty<ControlTheme?> ScrollButtonThemeProperty

ScrollDownButtonContentTemplateProperty

Defines the ScrollDownButtonContentTemplate property.

public static readonly StyledProperty<IDataTemplate?> ScrollDownButtonContentTemplateProperty

ScrollUpButtonContentTemplateProperty

Defines the ScrollUpButtonContentTemplate property.

public static readonly StyledProperty<IDataTemplate?> ScrollUpButtonContentTemplateProperty

ShadowColorProperty

Defines the ShadowColor property.

public static readonly StyledProperty<Color> ShadowColorProperty

ShadowOpacityProperty

Defines the ShadowOpacity property.

public static readonly StyledProperty<double> ShadowOpacityProperty

ToolWindowsColumnTitleProperty

Defines the ToolWindowsColumnTitle property.

public static readonly StyledProperty<string?> ToolWindowsColumnTitleProperty

Inherited Members

  • SwitcherBase.DockSiteProperty
  • SwitcherBase.IsOpenProperty
  • SwitcherBase.SelectedWindowProperty
  • SwitcherBase.SelectNextWindowKeyGestureProperty
  • SwitcherBase.SelectPreviousWindowKeyGestureProperty
  • SwitcherBase.Close()
  • SwitcherBase.CreatePopup()
  • SwitcherBase.IsActivationKey(KeyEventArgs)
  • SwitcherBase.OnKeyUp(KeyEventArgs)
  • SwitcherBase.OnLostFocus(RoutedEventArgs)
  • SwitcherBase.SelectNextWindow()
  • SwitcherBase.SelectPreviousWindow()
  • SwitcherBase.DockSite
  • SwitcherBase.Documents
  • SwitcherBase.IsOpen
  • SwitcherBase.SelectedWindow
  • SwitcherBase.SelectNextWindowKeyGesture
  • SwitcherBase.SelectPreviousWindowKeyGesture
  • SwitcherBase.ToolWindows
  • 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.PaddingProperty
  • TemplatedControl.TemplateProperty
  • TemplatedControl.IsTemplateFocusTargetProperty
  • TemplatedControl.TemplateAppliedEvent
  • TemplatedControl.GetIsTemplateFocusTarget(Control)
  • TemplatedControl.SetIsTemplateFocusTarget(Control, bool)
  • TemplatedControl.ApplyTemplate()
  • TemplatedControl.GetTemplateFocusTarget()
  • TemplatedControl.OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)
  • TemplatedControl.OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)
  • 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.Padding
  • TemplatedControl.Template
  • TemplatedControl.TemplateApplied
  • Control.FocusAdornerProperty
  • Control.TagProperty
  • Control.ContextMenuProperty
  • Control.ContextFlyoutProperty
  • Control.RequestBringIntoViewEvent
  • Control.ContextRequestedEvent
  • Control.LoadedEvent
  • Control.UnloadedEvent
  • Control.SizeChangedEvent
  • Control.OnLoaded(RoutedEventArgs)
  • Control.OnUnloaded(RoutedEventArgs)
  • Control.OnSizeChanged(SizeChangedEventArgs)
  • Control.OnAttachedToVisualTreeCore(VisualTreeAttachmentEventArgs)
  • Control.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs)
  • Control.OnGotFocus(GotFocusEventArgs)
  • Control.OnPointerReleased(PointerReleasedEventArgs)
  • Control.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
  • Control.FocusAdorner
  • Control.DataTemplates
  • Control.ContextMenu
  • Control.ContextFlyout
  • Control.IsLoaded
  • Control.Tag
  • Control.ContextRequested
  • 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.LostFocusEvent
  • 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.TappedEvent
  • InputElement.HoldingEvent
  • InputElement.DoubleTappedEvent
  • InputElement.Focus(NavigationMethod, KeyModifiers)
  • InputElement.OnAccessKey(RoutedEventArgs)
  • InputElement.OnTextInput(TextInputEventArgs)
  • InputElement.OnPointerEntered(PointerEventArgs)
  • InputElement.OnPointerExited(PointerEventArgs)
  • InputElement.OnPointerMoved(PointerEventArgs)
  • InputElement.OnPointerPressed(PointerPressedEventArgs)
  • InputElement.OnPointerCaptureLost(PointerCaptureLostEventArgs)
  • InputElement.OnPointerWheelChanged(PointerWheelEventArgs)
  • InputElement.UpdateIsEffectivelyEnabled()
  • 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.LostFocus
  • InputElement.KeyDown
  • InputElement.KeyUp
  • InputElement.TextInput
  • InputElement.TextInputMethodClientRequested
  • InputElement.PointerEntered
  • InputElement.PointerExited
  • InputElement.PointerMoved
  • InputElement.PointerPressed
  • InputElement.PointerReleased
  • InputElement.PointerCaptureLost
  • InputElement.PointerWheelChanged
  • InputElement.Tapped
  • InputElement.Holding
  • InputElement.DoubleTapped
  • Interactive.AddHandler(RoutedEvent, Delegate, RoutingStrategies, bool)
  • Interactive.AddHandler<TEventArgs>(RoutedEvent<TEventArgs>, EventHandler<TEventArgs>, RoutingStrategies, bool)
  • Interactive.RemoveHandler(RoutedEvent, Delegate)
  • Interactive.RemoveHandler<TEventArgs>(RoutedEvent<TEventArgs>, EventHandler<TEventArgs>)
  • 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.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.LogicalChildrenCollectionChanged(object, NotifyCollectionChangedEventArgs)
  • Visual.OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)
  • Visual.OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)
  • Visual.InvalidateMirrorTransform()
  • Visual.Bounds
  • Visual.ClipToBounds
  • Visual.Clip
  • Visual.IsEffectivelyVisible
  • Visual.IsVisible
  • Visual.Opacity
  • Visual.OpacityMask
  • 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.TryGetResource(object, ThemeVariant, out object)
  • StyledElement.OnDataContextChanged(EventArgs)
  • 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.Equals(object)
  • 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(AvaloniaProperty, object, BindingPriority)
  • AvaloniaObject.SetValue<T>(StyledProperty<T>, T, BindingPriority)
  • AvaloniaObject.SetValue<T>(DirectPropertyBase<T>, T)
  • AvaloniaObject.SetCurrentValue(AvaloniaProperty, object)
  • AvaloniaObject.SetCurrentValue<T>(StyledProperty<T>, T)
  • AvaloniaObject.Bind(AvaloniaProperty, IBinding)
  • AvaloniaObject.Bind(AvaloniaProperty, IObservable<object>, BindingPriority)
  • AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<object>, BindingPriority)
  • AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<T>, BindingPriority)
  • AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<BindingValue<T>>, BindingPriority)
  • AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<object>)
  • AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<T>)
  • AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<BindingValue<T>>)
  • AvaloniaObject.CoerceValue(AvaloniaProperty)
  • AvaloniaObject.UpdateDataValidation(AvaloniaProperty, BindingValueType, Exception)
  • AvaloniaObject.RaisePropertyChanged<T>(DirectPropertyBase<T>, T, T)
  • AvaloniaObject.SetAndRaise<T>(DirectPropertyBase<T>, ref T, T)
  • AvaloniaObject.InheritanceParent
  • AvaloniaObject.this[AvaloniaProperty]
  • AvaloniaObject.this[IndexerDescriptor]
  • AvaloniaObject.PropertyChanged
  • object.GetType()
  • object.MemberwiseClone()
  • object.ToString()
  • object.Equals(object, object)
  • object.ReferenceEquals(object, object)

Extension Methods