Utils Class

Summary

A few very useful extension methods
Namespace
MahApps.Metro.Controls
Base Types
  • object
graph BT Type-->Base0["object"] Type["Utils"] class Type type-node

Syntax

public static class Utils

Methods

Name Value Summary
CollapseThickness(Thickness) Size
Method to add up the left and right size as width, as well as the top and bottom size as height
static
Deflate(Rect, Thickness) Rect
Deflates rectangle by given thickness
static
Inflate(Rect, Thickness) Rect
Inflates rectangle by given thickness
static
IsCloseTo(double, double) bool
Returns whether or not two doubles are "close".
static
IsCloseTo(Point, Point) bool
Compares two points for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon
static
IsCloseTo(Rect, Rect) bool
Compares two rectangles for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon
static
IsCloseTo(Size, Size) bool
Compares two Size instances for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon
static
IsCloseTo(Vector, Vector) bool
Compares two Vector instances for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon
static
IsEqualTo(Brush, Brush) bool
Verifies if the given brush is the same as the otherBrush.
static
IsGreaterThan(double, double) bool
Returns whether or not the first double is greater than the second double.
static
IsLessThan(double, double) bool
Returns whether or not the first double is less than the second double.
static
IsNaN(double) bool
Faster check for NaN ( faster than double.IsNaN() ) IEEE 754 : If the argument is any value in the range 0x7ff0000000000001L through 0x7fffffffffffffffL or in the range 0xfff0000000000001L through 0xffffffffffffffffL, the result will be NaN.
static
IsOne(double) bool
Returns whether or not the double is "close" to 1. Same as AreClose(double, 1), but this is faster.
static
IsOpaqueSolidColorBrush(Brush) bool
Verifies if the given brush is a SolidColorBrush and its color does not include transparency.
static
IsUniform(CornerRadius) bool
Verifies if the CornerRadius contains same values
static
IsUniform(Thickness) bool
Verifies if all the values in Thickness are same
static
IsValid(CornerRadius, bool, bool, bool, bool) bool
Verifies if this CornerRadius contains only valid values The set of validity checks is passed as parameters.
static
IsValid(Thickness, bool, bool, bool, bool) bool
Verifies if this Thickness contains only valid values The set of validity checks is passed as parameters.
static
IsZero(CornerRadius) bool
Verifies if the CornerRadius contains only zero values
static
IsZero(double) bool
IsZero - Returns whether or not the double is "close" to 0. Same as AreClose(double, 0), but this is faster.
static
IsZero(Thickness) bool
Verifies if the Thickness contains only zero values
static
RoundLayoutValue(double, double) double
Rounds the given value based on the DPI scale
static