In This Article

Rating Class

Represents a rating control that allows the user to set or view a rating of an entity.

public class Rating : ItemsControl, IOrientedElement
Inheritance:
object Visual UIElement FrameworkElement Control ItemsControl object
Implements:
IOrientedElement

Constructors

Rating()

Initializes an instance of the class.

public Rating()

Properties

AverageValue

The average rating value currently presented by the control.

public double AverageValue { get; set; }

Property Value

double:

The default value is 0.0.

ClearValueCommand

The ICommand that can clear the value.

public ICommand ClearValueCommand { get; }

Property Value

ICommand

ItemCount

The number of items to display in the rating.

public int ItemCount { get; set; }

Property Value

int:

The default value is 0.

Orientation

The orientation of the element.

public Orientation Orientation { get; set; }

Property Value

Orientation:

The default value is Horizontal.

Value

The rating value currently presented by the control, if any.

public double? Value { get; set; }

Property Value

double?:

The default value is null.

Methods

OnCreateAutomationPeer()

Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

The type-specific AutomationPeer implementation.

OnItemsChanged(NotifyCollectionChangedEventArgs)

Invoked when the Items property changes.

protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameter Type Description
e NotifyCollectionChangedEventArgs

Information about the change.

OnKeyDown(KeyEventArgs)

Invoked when the KeyDown event is received.

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

Information about the event.

Events

ValueChanged

Occurs after the Value property value changes.

public event EventHandler? ValueChanged

Event Type

EventHandler

Fields

AverageValueProperty

Defines the AverageValue property.

public static readonly DependencyProperty AverageValueProperty

ItemCountProperty

Defines the ItemCount property.

public static readonly DependencyProperty ItemCountProperty

OrientationProperty

Defines the Orientation property.

public static readonly DependencyProperty OrientationProperty

ValueProperty

Defines the Value property.

public static readonly DependencyProperty ValueProperty

Extension Methods