Printer Friendly Version      Send     
Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Framework Class Library for Silverlight
RangeBase Class
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Represents an element that has a value within a specific range.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls (in System.Windows.Controls.dll)

Visual Basic (Declaration)
Public MustInherit Class RangeBase _
    Inherits Control
Visual Basic (Usage)
Dim instance As RangeBase
C#
public abstract class RangeBase : Control
Visual C++
public ref class RangeBase abstract : public Control
JScript
public abstract class RangeBase extends Control

A RangeBase control has a Value that can be set between the Minimum and Maximum properties. The RangeBase visually indicates its Value.

Property Validation and Coercion

The RangeBase control uses property coercion to ensure that the Minimum, Maximum, and Value properties preserve the relation Minimum ≤ Value ≤ Maximum. Coercion affects the return value of each property and not the value of its associated field. If the conditions causing coercion are removed, the return value of each property once again reflects the true value of its associated field.

Property validation and coercion rules are identical to those of the Windows Presentation Foundation (WPF) RangeBase control and are summarized in the following list. Rule precedence is in the following order.

1. Attempting to set Minimum, Maximum, Value, SmallChange, or LargeChange to NaN, NegativeInfinity, or PositiveInfinity raises an ArgumentException.

2. Attempting to set SmallChange or LargeChange to a value less than zero raises an ArgumentException.

3. The following property coercion rules apply.

If Value < Minimum, then Value = Minimum

The following table shows an example sequence of property settings and the resulting values for Minimum, Maximum, and Value.

Action

Minimum

Maximum

Value

Original settings

Local = 15

Property = 15

Local = 100

Property = 100

Local =30

Property = 30

Set Minimum = 200

Local = 200

Property = 200

Local = 100

Property = 200

Local = 30

Property = 200

Set Value = 45

Local = 200

Property = 200

Local = 100

Property = 200

Local = 45

Property = 200

Set Minimum = 0

Local = 0

Property = 0

Local = 100

Property = 100

Local = 45

Property = 45

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker