Class Expander
A control with a header that has a collapsible content section.
[PseudoClasses(new string[] { ":expanded", ":up", ":down", ":left", ":right" })]
public class Expander : HeaderedContentControl, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue
- Inheritance
-
Expander
- Implements
- Inherited Members
- Extension Methods
Constructors
Expander()
Initializes a new instance of the Expander class.
public Expander()
Fields
CollapsedEvent
Defines the Collapsed event.
public static readonly RoutedEvent<RoutedEventArgs> CollapsedEvent
Field Value
CollapsingEvent
Defines the Collapsing event.
public static readonly RoutedEvent<CancelRoutedEventArgs> CollapsingEvent
Field Value
ContentTransitionProperty
Defines the ContentTransition property.
public static readonly StyledProperty<IPageTransition?> ContentTransitionProperty
Field Value
ExpandDirectionProperty
Defines the ExpandDirection property.
public static readonly StyledProperty<ExpandDirection> ExpandDirectionProperty
Field Value
ExpandedEvent
Defines the Expanded event.
public static readonly RoutedEvent<RoutedEventArgs> ExpandedEvent
Field Value
ExpandingEvent
Defines the Expanding event.
public static readonly RoutedEvent<CancelRoutedEventArgs> ExpandingEvent
Field Value
IsExpandedProperty
Defines the IsExpanded property.
public static readonly StyledProperty<bool> IsExpandedProperty
Field Value
Properties
ContentTransition
Gets or sets the transition used when expanding or collapsing the content.
public IPageTransition? ContentTransition { get; set; }
Property Value
ExpandDirection
Gets or sets the direction in which the Expander opens.
public ExpandDirection ExpandDirection { get; set; }
Property Value
IsExpanded
Gets or sets a value indicating whether the Expander content area is open and visible.
public bool IsExpanded { get; set; }
Property Value
Methods
OnCoerceIsExpanded(bool)
Called when the IsExpanded property has to be coerced.
protected virtual bool OnCoerceIsExpanded(bool value)
Parameters
value
boolThe value to coerce.
Returns
OnCollapsed(RoutedEventArgs)
Invoked just before the Collapsed event.
protected virtual void OnCollapsed(RoutedEventArgs eventArgs)
Parameters
eventArgs
RoutedEventArgs
OnCollapsing(CancelRoutedEventArgs)
Invoked just before the Collapsing event.
protected virtual void OnCollapsing(CancelRoutedEventArgs eventArgs)
Parameters
eventArgs
CancelRoutedEventArgs
OnExpanded(RoutedEventArgs)
Invoked just before the Expanded event.
protected virtual void OnExpanded(RoutedEventArgs eventArgs)
Parameters
eventArgs
RoutedEventArgs
OnExpanding(CancelRoutedEventArgs)
Invoked just before the Expanding event.
protected virtual void OnExpanding(CancelRoutedEventArgs eventArgs)
Parameters
eventArgs
CancelRoutedEventArgs
OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
Called when a avalonia property changes on the object.
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
Parameters
change
AvaloniaPropertyChangedEventArgsThe property change details.
Events
Collapsed
Occurs after the content area has closed and only the header is visible.
public event EventHandler<RoutedEventArgs>? Collapsed
Event Type
Collapsing
Occurs as the content area is closing.
public event EventHandler<CancelRoutedEventArgs>? Collapsing
Event Type
Remarks
The event args Cancel property may be set to true to cancel the event and keep the control open (expanded).
Expanded
Occurs after the Expander has opened to display both its header and content.
public event EventHandler<RoutedEventArgs>? Expanded
Event Type
Expanding
Occurs as the content area is opening.
public event EventHandler<CancelRoutedEventArgs>? Expanding
Event Type
Remarks
The event args Cancel property may be set to true to cancel the event and keep the control closed (collapsed).