Table of Contents

Class RatingControl

Namespace
Nova.Avalonia.UI.Controls
Assembly
Nova.Avalonia.UI.dll

A Rating Control with support to various shapes or precision levels.

public class RatingControl : TemplatedControl, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue
Inheritance
AvaloniaObject
Animatable
StyledElement
Visual
Layoutable
Interactive
InputElement
Control
TemplatedControl
RatingControl
Implements
IDataContextProvider
ILogical
IThemeVariantHost
IResourceHost
IResourceNode
IStyleHost
ISetLogicalParent
ISetInheritanceParent
IStyleable
INamed
IInputElement
IDataTemplateHost
ISetterValue
Inherited Members
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.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.OnLostFocus(RoutedEventArgs)
Control.OnCreateAutomationPeer()
Control.OnKeyUp(KeyEventArgs)
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.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.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.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.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.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, IBinding)
AvaloniaObject.CoerceValue(AvaloniaProperty)
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

Fields

CustomGeometryProperty

Defines the CustomGeometry property.

public static readonly StyledProperty<Geometry?> CustomGeometryProperty

Field Value

StyledProperty<Geometry>

IsReadOnlyProperty

Defines the IsReadOnly property.

public static readonly StyledProperty<bool> IsReadOnlyProperty

Field Value

StyledProperty<bool>

ItemCountProperty

Defines the ItemCount property.

public static readonly StyledProperty<int> ItemCountProperty

Field Value

StyledProperty<int>

ItemSizeProperty

Defines the ItemSize property.

public static readonly StyledProperty<double> ItemSizeProperty

Field Value

StyledProperty<double>

ItemSpacingProperty

Defines the ItemSpacing property.

public static readonly StyledProperty<double> ItemSpacingProperty

Field Value

StyledProperty<double>

OrientationProperty

Defines the Orientation property.

public static readonly StyledProperty<Orientation> OrientationProperty

Field Value

StyledProperty<Orientation>

PrecisionProperty

Defines the Precision property.

public static readonly StyledProperty<RatingPrecision> PrecisionProperty

Field Value

StyledProperty<RatingPrecision>

PreviewFillProperty

Defines the PreviewFill property.

public static readonly StyledProperty<IBrush?> PreviewFillProperty

Field Value

StyledProperty<IBrush>

PreviewStrokeProperty

Defines the PreviewStroke property.

public static readonly StyledProperty<IBrush?> PreviewStrokeProperty

Field Value

StyledProperty<IBrush>

RatedFillProperty

Defines the RatedFill property.

public static readonly StyledProperty<IBrush?> RatedFillProperty

Field Value

StyledProperty<IBrush>

RatedStrokeProperty

Defines the RatedStroke property.

public static readonly StyledProperty<IBrush?> RatedStrokeProperty

Field Value

StyledProperty<IBrush>

ShapeProperty

Defines the Shape property.

public static readonly StyledProperty<RatingShape> ShapeProperty

Field Value

StyledProperty<RatingShape>

StrokeThicknessProperty

Defines the StrokeThickness property.

public static readonly StyledProperty<double> StrokeThicknessProperty

Field Value

StyledProperty<double>

UnratedFillProperty

Defines the UnratedFill property.

public static readonly StyledProperty<IBrush?> UnratedFillProperty

Field Value

StyledProperty<IBrush>

UnratedStrokeProperty

Defines the UnratedStroke property.

public static readonly StyledProperty<IBrush?> UnratedStrokeProperty

Field Value

StyledProperty<IBrush>

ValueChangedEvent

Defines the ValueChanged routed event.

public static readonly RoutedEvent<RoutedEventArgs> ValueChangedEvent

Field Value

RoutedEvent<RoutedEventArgs>

ValueProperty

Defines the Value property.

public static readonly StyledProperty<double> ValueProperty

Field Value

StyledProperty<double>

Properties

CustomGeometry

Gets or sets the custom geometry to use when Shape is set to Custom.

public Geometry? CustomGeometry { get; set; }

Property Value

Geometry

IsReadOnly

Gets or sets a value indicating whether the control is read-only.

public bool IsReadOnly { get; set; }

Property Value

bool

ItemCount

Gets or sets the number of items (stars, hearts, etc.) to display.

public int ItemCount { get; set; }

Property Value

int

ItemSize

Gets or sets the size of each rating item.

public double ItemSize { get; set; }

Property Value

double

ItemSpacing

Gets or sets the spacing between rating items.

public double ItemSpacing { get; set; }

Property Value

double

Orientation

Gets or sets the orientation of the rating items (Horizontal or Vertical).

public Orientation Orientation { get; set; }

Property Value

Orientation

Precision

Gets or sets the precision of the rating (Full, Half, or Exact).

public RatingPrecision Precision { get; set; }

Property Value

RatingPrecision

PreviewFill

Gets or sets the fill brush used when hovering over items.

public IBrush? PreviewFill { get; set; }

Property Value

IBrush

PreviewStroke

Gets or sets the stroke brush used when hovering over items.

public IBrush? PreviewStroke { get; set; }

Property Value

IBrush

RatedFill

Gets or sets the fill brush for rated items (active state).

public IBrush? RatedFill { get; set; }

Property Value

IBrush

RatedStroke

Gets or sets the stroke brush for rated items.

public IBrush? RatedStroke { get; set; }

Property Value

IBrush

Shape

Gets or sets the shape of the rating items.

public RatingShape Shape { get; set; }

Property Value

RatingShape

StrokeThickness

Gets or sets the thickness of the stroke for items.

public double StrokeThickness { get; set; }

Property Value

double

UnratedFill

Gets or sets the fill brush for unrated items (inactive state).

public IBrush? UnratedFill { get; set; }

Property Value

IBrush

UnratedStroke

Gets or sets the stroke brush for unrated items.

public IBrush? UnratedStroke { get; set; }

Property Value

IBrush

Value

Gets or sets the current value of the rating.

public double Value { get; set; }

Property Value

double

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)

Parameters

e TemplateAppliedEventArgs

The event args.

OnKeyDown(KeyEventArgs)

Invoked when an unhandled Avalonia.Input.InputElement.KeyDownEvent 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 OnKeyDown(KeyEventArgs e)

Parameters

e KeyEventArgs

Data about the event.

OnPointerEntered(PointerEventArgs)

Invoked when an unhandled Avalonia.Input.InputElement.PointerEnteredEvent 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 OnPointerEntered(PointerEventArgs e)

Parameters

e PointerEventArgs

Data about the event.

OnPointerExited(PointerEventArgs)

Invoked when an unhandled Avalonia.Input.InputElement.PointerExitedEvent 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 OnPointerExited(PointerEventArgs e)

Parameters

e PointerEventArgs

Data about the event.

OnPointerMoved(PointerEventArgs)

Invoked when an unhandled Avalonia.Input.InputElement.PointerMovedEvent 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 OnPointerMoved(PointerEventArgs e)

Parameters

e PointerEventArgs

Data about the event.

OnPointerPressed(PointerPressedEventArgs)

Invoked when an unhandled Avalonia.Input.InputElement.PointerPressedEvent 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 OnPointerPressed(PointerPressedEventArgs e)

Parameters

e PointerPressedEventArgs

Data about the event.

OnPointerReleased(PointerReleasedEventArgs)

Invoked when an unhandled Avalonia.Input.InputElement.PointerReleasedEvent 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 OnPointerReleased(PointerReleasedEventArgs e)

Parameters

e PointerReleasedEventArgs

Data about the event.

Events

ValueChanged

Occurs when the Value property changes.

public event EventHandler<RoutedEventArgs>? ValueChanged

Event Type

EventHandler<RoutedEventArgs>