Table of Contents

Class RatingControl

Namespace
Wpf.Ui.Controls
Assembly
Wpf.Ui.dll

Displays the rating scale with interactions.

[TemplatePart(Name = "PART_Star1", Type = typeof(SymbolIcon))]
[TemplatePart(Name = "PART_Star2", Type = typeof(SymbolIcon))]
[TemplatePart(Name = "PART_Star3", Type = typeof(SymbolIcon))]
[TemplatePart(Name = "PART_Star4", Type = typeof(SymbolIcon))]
[TemplatePart(Name = "PART_Star5", Type = typeof(SymbolIcon))]
public class RatingControl : ContentControl, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild
Inheritance
RatingControl
Implements
Inherited Members

Fields

HalfStarEnabledProperty

Identifies the HalfStarEnabled dependency property.

public static readonly DependencyProperty HalfStarEnabledProperty

Field Value

DependencyProperty

MaxRatingProperty

Identifies the MaxRating dependency property.

public static readonly DependencyProperty MaxRatingProperty

Field Value

DependencyProperty

ValueChangedEvent

Identifies the ValueChanged routed event.

public static readonly RoutedEvent ValueChangedEvent

Field Value

RoutedEvent

ValueProperty

Identifies the Value dependency property.

public static readonly DependencyProperty ValueProperty

Field Value

DependencyProperty

Properties

HalfStarEnabled

Gets or sets a value indicating whether half of the star can be selected.

public bool HalfStarEnabled { get; set; }

Property Value

bool

MaxRating

Gets or sets the maximum allowed rating value.

public int MaxRating { get; set; }

Property Value

int

Value

Gets or sets the rating value.

public double Value { get; set; }

Property Value

double

Methods

OnApplyTemplate()

Is called when Template is changed.

public override void OnApplyTemplate()

OnKeyUp(KeyEventArgs)

Adjusts the control's Value in response to keyboard input, incrementing or decrementing based on the key pressed.

protected override void OnKeyUp(KeyEventArgs e)

Parameters

e KeyEventArgs

Key event arguments containing details about the key press.

OnMouseDown(MouseButtonEventArgs)

Is called when mouse is cliked down.

protected override void OnMouseDown(MouseButtonEventArgs e)

Parameters

e MouseButtonEventArgs

OnMouseLeave(MouseEventArgs)

Is called when mouse is moved away from the control.

protected override void OnMouseLeave(MouseEventArgs e)

Parameters

e MouseEventArgs

OnMouseMove(MouseEventArgs)

Is called when mouse is moved around the control.

protected override void OnMouseMove(MouseEventArgs e)

Parameters

e MouseEventArgs

OnValueChanged(double)

Is called when Value changes.

protected virtual void OnValueChanged(double oldValue)

Parameters

oldValue double

Events

ValueChanged

Occurs after the user selects the rating.

public event RoutedEventHandler ValueChanged

Event Type

RoutedEventHandler