Class Rating
A control that has a rating.
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.Controls.Input.Toolkit.dll
Syntax
[StyleTypedProperty(Property = "ItemContainerStyle", StyleTargetType = typeof(RatingItem))]
public class Rating : ItemsControl, IControl, IFrameworkElement, IUIElement, IDependencyObject
Constructors
| Improve this Doc View SourceRating()
Initializes a new instance of the Rating control.
Declaration
public Rating()
Fields
| Improve this Doc View SourceDisplayValueProperty
Identifies the DisplayValue dependency property.
Declaration
protected static readonly DependencyProperty DisplayValueProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsReadOnlyProperty
Identifies the IsReadOnly dependency property.
Declaration
public static readonly DependencyProperty IsReadOnlyProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ItemContainerStyleProperty
Identifies the ItemContainerStyle dependency property.
Declaration
public static readonly DependencyProperty ItemContainerStyleProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ItemCountProperty
Identifies the ItemCount dependency property.
Declaration
public static readonly DependencyProperty ItemCountProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
SelectionModeProperty
Identifies the SelectionMode dependency property.
Declaration
public static readonly DependencyProperty SelectionModeProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ValueProperty
Identifies the Value dependency property.
Declaration
public static readonly DependencyProperty ValueProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceDisplayValue
Gets or sets the actual value of the Rating control.
Declaration
protected double DisplayValue { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
IsReadOnly
Gets or sets a value indicating whether the Rating is read-only.
Declaration
public bool IsReadOnly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ItemContainerStyle
Gets or sets the item container style.
Declaration
public Style ItemContainerStyle { get; set; }
Property Value
Type | Description |
---|---|
Style |
ItemCount
Gets or sets the number of rating items.
Declaration
public int ItemCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
SelectionMode
Gets or sets the selection mode.
Declaration
public RatingSelectionMode SelectionMode { get; set; }
Property Value
Type | Description |
---|---|
RatingSelectionMode |
Value
Gets or sets the rating value.
Declaration
[TypeConverter(typeof(NullableConverter<double>))]
public double? Value { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Double> |
Methods
| Improve this Doc View SourceClearContainerForItemOverride(DependencyObject, Object)
This method clears a container used to host an item.
Declaration
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | element | The container that hosts the item. |
System.Object | item | The item hosted in the container. |
Overrides
| Improve this Doc View SourceGetContainerForItemOverride()
This method returns a container for the item.
Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
Type | Description |
---|---|
DependencyObject | A container for the item. |
Overrides
| Improve this Doc View SourceIsItemItsOwnContainerOverride(Object)
Gets a value indicating whether the item is its own container.
Declaration
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters
Type | Name | Description |
---|---|---|
System.Object | item | The item which may be a container. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether the item is its own container. |
Overrides
| Improve this Doc View SourceOnApplyTemplate()
Applies control template to the items control.
Declaration
public override void OnApplyTemplate()
Overrides
| Improve this Doc View SourceOnCreateAutomationPeer()
Returns a RatingItemAutomationPeer for use by the Silverlight automation infrastructure.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type | Description |
---|---|
AutomationPeer | A RatingItemAutomationPeer object for the RatingItem. |
Overrides
| Improve this Doc View SourceOnIsReadOnlyChanged(Boolean, Boolean)
IsReadOnlyProperty property changed handler.
Declaration
protected virtual void OnIsReadOnlyChanged(bool oldValue, bool newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | oldValue | Old value. |
System.Boolean | newValue | New value. |
OnItemContainerStyleChanged(Style)
ItemContainerStyleProperty property changed handler.
Declaration
protected virtual void OnItemContainerStyleChanged(Style newValue)
Parameters
Type | Name | Description |
---|---|---|
Style | newValue | New value. |
OnItemsChanged(NotifyCollectionChangedEventArgs)
Updates the control when the items change.
Declaration
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NotifyCollectionChangedEventArgs | e | Information about the event. |
Overrides
| Improve this Doc View SourceOnKeyDown(KeyEventArgs)
Provides handling for the KeyDown event when a key is pressed while the control has focus.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
KeyEventArgs | e | A KeyEventArgs that contains the event data. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
OnMouseEnter(MouseEventArgs)
This method is invoked when the mouse enters the rating item.
Declaration
protected override void OnMouseEnter(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseEventArgs | e | Information about the event. |
Overrides
| Improve this Doc View SourceOnMouseLeave(MouseEventArgs)
This method is invoked when the mouse leaves the rating item.
Declaration
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseEventArgs | e | Information about the event. |
Overrides
| Improve this Doc View SourceOnMouseLeftButtonDown(MouseButtonEventArgs)
Provides handling for the Rating's MouseLeftButtonDown event.
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseButtonEventArgs | e | Event arguments. |
Overrides
| Improve this Doc View SourceOnMouseLeftButtonUp(MouseButtonEventArgs)
Provides handling for the Rating's MouseLeftButtonUp event.
Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseButtonEventArgs | e | Event arguments. |
Overrides
| Improve this Doc View SourceOnRatingItemValueSelected(RatingItem, Double)
This method is invoked when the rating item value is changed.
Declaration
protected virtual void OnRatingItemValueSelected(RatingItem ratingItem, double newValue)
Parameters
Type | Name | Description |
---|---|---|
RatingItem | ratingItem | The rating item that has changed. |
System.Double | newValue | The new value. |
OnSelectionModeChanged(RatingSelectionMode, RatingSelectionMode)
SelectionModeProperty property changed handler.
Declaration
protected virtual void OnSelectionModeChanged(RatingSelectionMode oldValue, RatingSelectionMode newValue)
Parameters
Type | Name | Description |
---|---|---|
RatingSelectionMode | oldValue | Old value. |
RatingSelectionMode | newValue | New value. |
OnValueChanged(Nullable<Double>, Nullable<Double>)
ValueProperty property changed handler.
Declaration
protected virtual void OnValueChanged(double? oldValue, double? newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Double> | oldValue | Old value. |
System.Nullable<System.Double> | newValue | New value. |
PrepareContainerForItemOverride(DependencyObject, Object)
This method prepares a container to host an item.
Declaration
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | element | The container. |
System.Object | item | The item hosted in the container. |
Overrides
Events
| Improve this Doc View SourceValueChanged
This event is raised when the value of the rating is changed.
Declaration
public event RoutedPropertyChangedEventHandler<double?> ValueChanged
Event Type
Type | Description |
---|---|
RoutedPropertyChangedEventHandler<System.Nullable<System.Double>> |