Class DeviceVisualizer
Visualizes an ArtemisDevice with optional per-LED colors
Inheritance
Implements
Inherited Members
Namespace: Artemis.UI.Shared
Assembly: Artemis.UI.Shared.dll
Syntax
public class DeviceVisualizer : Control, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, IStyleable, IInputElement, IDataTemplateHost, INamed, ISetterValue
Constructors
DeviceVisualizer()
Declaration
public DeviceVisualizer()
Fields
DeviceProperty
Gets or sets the ArtemisDevice to display
Declaration
public static readonly StyledProperty<ArtemisDevice?> DeviceProperty
Field Value
Type | Description |
---|---|
StyledProperty<ArtemisDevice> |
ShowColorsProperty
Gets or sets boolean indicating whether or not to show per-LED colors
Declaration
public static readonly StyledProperty<bool> ShowColorsProperty
Field Value
Type | Description |
---|---|
StyledProperty<bool> |
Properties
Device
Gets or sets the ArtemisDevice to display
Declaration
public ArtemisDevice? Device { get; set; }
Property Value
Type | Description |
---|---|
ArtemisDevice |
ShowColors
Gets or sets a boolean indicating whether or not to show per-LED colors
Declaration
public bool ShowColors { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
MeasureOverride(Size)
Measures the control and its child elements as part of a layout pass.
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
Type | Name | Description |
---|---|---|
Size | availableSize | The size available to the control. |
Returns
Type | Description |
---|---|
Size | The desired size for the control. |
Overrides
OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)
Called when the styled element is added to a rooted logical tree.
Declaration
protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
LogicalTreeAttachmentEventArgs | e | The event args. |
Overrides
OnClicked(PointerReleasedEventArgs)
Invokes the Clicked event
Declaration
protected virtual void OnClicked(PointerReleasedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
PointerReleasedEventArgs | e |
OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)
Called when the styled element is removed from a rooted logical tree.
Declaration
protected override void OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
LogicalTreeAttachmentEventArgs | e | The event args. |
Overrides
OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)
Called when the control is removed from a rooted visual tree.
Declaration
protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
VisualTreeAttachmentEventArgs | e | The event args. |
Overrides
OnLedClicked(LedClickedEventArgs)
Invokes the LedClicked event
Declaration
protected virtual void OnLedClicked(LedClickedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
LedClickedEventArgs | e |
Render(DrawingContext)
Renders the visual to a Avalonia.Media.DrawingContext.
Declaration
public override void Render(DrawingContext drawingContext)
Parameters
Type | Name | Description |
---|---|---|
DrawingContext | drawingContext |
Overrides
Events
Clicked
Occurs when the device was clicked but not on a LED.
Declaration
public event EventHandler<PointerReleasedEventArgs>? Clicked
Event Type
Type | Description |
---|---|
EventHandler<PointerReleasedEventArgs> |
LedClicked
Occurs when a LED of the device has been clicked
Declaration
public event EventHandler<LedClickedEventArgs>? LedClicked
Event Type
Type | Description |
---|---|
EventHandler<LedClickedEventArgs> |