Utils Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Class containing collection of useful methods for various types
public static class Utils
type Utils = class
Public Module Utils
- Inheritance
-
Utils
Collapse(Vector4) |
Useful in converting the four components of Thickness or Padding to two components by taking a sum of alternate components (X & Z and Y & W). |
Collapse |
Method to add up the left and right size as width, as well as the top and bottom size as height. |
Convert |
Converts the given corner value to a valid positive value. Returns zero if the corner value is Infinity or NaN or 0. |
Darker |
Darkens the color by the given percentage. |
Deflate(Rect, Thickness) |
Deflates rectangle by given thickness. |
Get |
Gets the top left corner of the thickness structure. |
Get |
Calculates the best size that can fit in the destination area based on the given stretch and alignment options. |
Inflate(Rect, Thickness) |
Inflates rectangle by given thickness. |
Is |
Returns whether or not two doubles are "close". |
Is |
Compares two points for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon |
Is |
Compares two rectangles for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon |
Is |
Returns whether or not two floats are "close". |
Is |
Compares two Size instances for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon |
Is |
Verifies if the given brush is the same as the otherBrush. |
Is |
Compares one URI with another URI. |
Is |
Returns whether or not the first double is greater than the second double. |
Is |
Returns whether or not the first float is greater than the second float. |
Is |
Returns whether or not the first double is less than the second double. |
Is |
Returns whether or not the first float is less than the second float. |
Is |
Returns whether or not the double is "close" to 1. Same as AreClose(double, 1), but this is faster. |
Is |
Returns whether or not the float is "close" to 1. Same as AreClose(float, 1), but this is faster. |
Is |
Verifies if the given brush is a SolidColorBrush and its color does not include transparency. |
Is |
Verifies if the CornerRadius contains same values. |
Is |
Verifies if all the values in Thickness are same. |
Is |
Verifies if this Thickness contains only valid values. The set of validity checks is passed as parameters. |
Is |
Verifies if the CornerRadius contains only zero values. |
Is |
IsZero - Returns whether or not the double is "close" to 0. Same as AreClose(double, 0), but this is faster. |
Is |
IsZero - Returns whether or not the float is "close" to 0. Same as AreClose(float, 0), but this is faster. |
Is |
Verifies if the Thickness contains only zero values. |
Is |
Verifies if the Vector4 contains only zero values. |
Lerp(Color, Color, Single) |
Calculates the linear interpolated Color based on the given Color values. |
Lerp(Single, Single, Single) |
Calculates the linear interpolated value based on the given values. |
Lighter |
Lightens the color by the given percentage. |
Reflect(Vector2, Vector2) |
Reflects point 'a' over point 'b'. |
Round |
Rounds the given value based on the DPI scale |
To |
Converts the Thickness object to Vector4. If the Thickness object contains negative components they will be converted to positive values. If the Thickness object's component have values NaN, PositiveInfinity or NegativeInfinity, then Vector4.Zero will be returned. |
To |
Converts the Vector4 to CornerRadius - TopLeft(X), TopRight(Y), BottomRight(Z), BottomLeft(W). |
To |
Useful in converting the four components of Thickness or Padding to two components by adding alternate components - (X & Z and Y & W). |
To |
Converts the Vector4 to Thickness - Left(X), Top(Y), Right(Z), Bottom(W). |
To |
Converts the Point structure P (X,Y) to Vector3 structure V (P.X, P.Y, 0); |
To |
Converts a Vector2 structure (x,y) to Vector3 structure (x, y, 0). |
To |
Converts the CornerRadius object to Vector4. If the CornerRadius object's component have values NaN, PositiveInfinity or NegativeInfinity, then Vector4.Zero will be returned. |
To |
Converts the Thickness object to Vector4. If the Thickness object's component have values NaN, PositiveInfinity or NegativeInfinity, then Vector4.Zero will be returned. |
Produit | Versions |
---|---|
Windows Community Toolkit | 7.0.0, 7.1.0 |