In This Article

Data

The ActiproSoftware.Windows.Data namespace contains several classes that are helpful for working with data.

Value Converters

There are numerous value converter classes in this namespace.

All of the available value converters from this namespace and others in the Shared Library are described in the Value Converters topic.

The MathHelper Class

The MathHelper class provides static methods that provide additional math operations not found in the Math class.

Member Description
Max Method Returns the largest value from the specified numbers.
Min Method Returns the smallest value from the specified numbers.
Range Method Returns the specified value constrained to the specified minimum and maximum values.
Round Method Rounds a double value based on the specified RoundMode, which supports several methods of rounding the value.

The NullableExtension Class

The NullableExtension class is a markup extension that can be used to define an instance of Nullable<T> in XAML.

The ValidationHelper Class

The ValidationHelper class provides a number of static methods that can be called in the validation argument of a dependency property registration.

Member Description
ValidateDoubleIsBetweenInclusive Method Validates that the object is a Double whose value is inclusively between two numbers.
ValidateDoubleIsGreaterThan Method Validates that the object is a Double greater than the specified number.
ValidateDoubleIsGreaterThanOrEqual Method Validates that the object is a Double greater than or equal to the specified number.
ValidateDoubleIsNumber Method Validates that the object is a Double is not NaN or infinity.
ValidateDoubleIsNumberOrNaN Method Validates that the object is a Double is not infinity.
ValidateDoubleIsPercentage Method Validates that the object is a Double between 0 and 1 inclusive.
ValidateDoubleIsPositive Method Validates that the object is a Double greater than or equal to 0.
ValidateDoubleIsPositiveOrNaN Method Validates that the object is a Double greater than or equal to 0 or NaN.
ValidateDurationIsPositiveTimeSpan Method Validates that the object is a Duration is a positive TimeSpan.
ValidateInt32IsBetweenInclusive Method Validates that the object is an Int32 whose value is inclusively between two numbers.
ValidateInt32IsGreaterThanOrEqual Method Validates that the object is an Int32 greater than or equal to the specified number.
ValidateInt32IsPositive Method Validates that the object is an Int32 greater than or equal to 0.
ValidateInt64IsBetweenInclusive Method Validates that the object is an Int64 whose value is inclusively between two numbers.
ValidateInt64IsGreaterThanOrEqual Method Validates that the object is an Int64 greater than or equal to the specified number.
ValidateInt64IsPositive Method Validates that the object is an Int64 greater than or equal to 0.

This sample code shows how to use the ValidateDoubleIsPercentage method to validate that the dependency property value is a valid percentage.

public static DependencyProperty PercentProperty = 
	DependencyProperty.Register("Percent", typeof(double), typeof(MyClass), new FrameworkPropertyMetadata(0.0), 
	new ValidateValueCallback(ValidationHelper.ValidateDoubleIsPercentage));