Class RatingControl
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
MaxRatingProperty
Identifies the MaxRating dependency property.
public static readonly DependencyProperty MaxRatingProperty
Field Value
ValueChangedEvent
Identifies the ValueChanged routed event.
public static readonly RoutedEvent ValueChangedEvent
Field Value
ValueProperty
Identifies the Value dependency property.
public static readonly DependencyProperty ValueProperty
Field Value
Properties
HalfStarEnabled
Gets or sets a value indicating whether half of the star can be selected.
public bool HalfStarEnabled { get; set; }
Property Value
MaxRating
Gets or sets the maximum allowed rating value.
public int MaxRating { get; set; }
Property Value
Value
Gets or sets the rating value.
public double Value { get; set; }
Property Value
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
KeyEventArgsKey event arguments containing details about the key press.
OnMouseDown(MouseButtonEventArgs)
Is called when mouse is cliked down.
protected override void OnMouseDown(MouseButtonEventArgs e)
Parameters
OnMouseLeave(MouseEventArgs)
Is called when mouse is moved away from the control.
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
OnMouseMove(MouseEventArgs)
Is called when mouse is moved around the control.
protected override void OnMouseMove(MouseEventArgs e)
Parameters
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