menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridUtil - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class GridUtil

    Helper routines.

    Inheritance
    System.Object
    GridUtil
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Windows.GridCommon
    Assembly: Syncfusion.GridCommon.WPF.dll
    Syntax
    public class GridUtil

    Constructors

    GridUtil()

    Declaration
    public GridUtil()

    Properties

    IsAnimated

    Gets or sets a value indicating whether WPF controls are animated. See also System.Windows.SystemParameters.ClientAreaAnimation.

    Declaration
    public static bool IsAnimated { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if WPF controls are animated; otherwise, false.

    Methods

    AllSet(Int32, Int32)

    Determines if all of the specified flags are set.

    Declaration
    public static bool AllSet(int value, int flags)
    Parameters
    Type Name Description
    System.Int32 value

    The value.

    System.Int32 flags

    The flags.

    Returns
    Type
    System.Boolean

    ClearBits(ref Int32, Int32)

    Resets the specified flags.

    Declaration
    public static void ClearBits(ref int value, int flags)
    Parameters
    Type Name Description
    System.Int32 value

    The value.

    System.Int32 flags

    The flags.

    FromLTRB(Double, Double, Double, Double)

    Creates a rectangle.

    Declaration
    public static Rect FromLTRB(double left, double top, double right, double bottom)
    Parameters
    Type Name Description
    System.Double left

    The left.

    System.Double top

    The top.

    System.Double right

    The right.

    System.Double bottom

    The bottom.

    Returns
    Type
    System.Windows.Rect

    GetHoverColor(Brush, Double)

    Declaration
    public static Brush GetHoverColor(Brush brush, double offset)
    Parameters
    Type Name Description
    System.Windows.Media.Brush brush
    System.Double offset
    Returns
    Type
    System.Windows.Media.Brush

    GetMouseButton()

    Gets the pressed mouse button.

    Declaration
    public static MouseButton? GetMouseButton()
    Returns
    Type
    System.Nullable<System.Windows.Input.MouseButton>

    GetMouseButton(MouseEventArgs)

    Gets the pressed mouse button.

    Declaration
    public static MouseButton? GetMouseButton(MouseEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.MouseEventArgs e

    The System.Windows.Input.MouseEventArgs instance containing the event data.

    Returns
    Type
    System.Nullable<System.Windows.Input.MouseButton>

    GetParent(DependencyObject)

    Declaration
    public static DependencyObject GetParent(DependencyObject current)
    Parameters
    Type Name Description
    System.Windows.DependencyObject current
    Returns
    Type
    System.Windows.DependencyObject

    GetSize(Rect)

    Declaration
    public static Size GetSize(Rect rect)
    Parameters
    Type Name Description
    System.Windows.Rect rect
    Returns
    Type
    System.Windows.Size

    GetSurroundingRect(Point, Size)

    Gets the surrounding rect.

    Declaration
    public static Rect GetSurroundingRect(Point pt, Size size)
    Parameters
    Type Name Description
    System.Windows.Point pt

    The pt.

    System.Windows.Size size

    The size.

    Returns
    Type
    System.Windows.Rect

    GetValueInherited(DependencyObject, DependencyProperty, Object)

    Gets the value from the specified object. If the value was not set for the object then the method will walk up parent nodes until it finds a parent object with the value set.

    Declaration
    public static object GetValueInherited(DependencyObject dpo, DependencyProperty dp, object defaultValue)
    Parameters
    Type Name Description
    System.Windows.DependencyObject dpo

    The dependency object.

    System.Windows.DependencyProperty dp

    The dp.

    System.Object defaultValue

    The default value.

    Returns
    Type
    System.Object

    GetValueInherited(DependencyObject, DependencyProperty, Object, out DependencyObject)

    Gets the value from the specified object. If the value was not set for the object then the method will walk up parent nodes until it finds a parent object with the value set.

    Declaration
    public static object GetValueInherited(DependencyObject dobj, DependencyProperty dp, object defaultValue, out DependencyObject dpo)
    Parameters
    Type Name Description
    System.Windows.DependencyObject dobj

    The dependency object.

    System.Windows.DependencyProperty dp

    The dependency property.

    System.Object defaultValue

    The default value.

    System.Windows.DependencyObject dpo

    The parent object in which the value was set.

    Returns
    Type
    System.Object

    GetValueInherited(DependencyObject, DependencyProperty, DependencyProperty, Object)

    Gets the value from the specified object. If the value was not set for the object then the method will walk up parent nodes until it finds a parent object with the value set.

    Declaration
    public static object GetValueInherited(DependencyObject dpo, DependencyProperty dp, DependencyProperty dp2, object defaultValue)
    Parameters
    Type Name Description
    System.Windows.DependencyObject dpo

    The dependency object.

    System.Windows.DependencyProperty dp

    The dp.

    System.Windows.DependencyProperty dp2
    System.Object defaultValue

    The default value.

    Returns
    Type
    System.Object

    GetXamlConvertedValue<T>(String)

    Declaration
    public static T GetXamlConvertedValue<T>(string value)
    Parameters
    Type Name Description
    System.String value
    Returns
    Type
    T
    Type Parameters
    Name
    T

    IsDoubleClick(Point, Int32, Point)

    Determines whether a point is within double click range of another point and also ensures that the click was within double click time.

    Declaration
    public static bool IsDoubleClick(Point pt, int mouseDownTick, Point mouseDownPoint)
    Parameters
    Type Name Description
    System.Windows.Point pt

    The pt.

    System.Int32 mouseDownTick

    The mouse down tick (Environment.TickCount at time of click).

    System.Windows.Point mouseDownPoint

    The mouse down point.

    Returns
    Type Description
    System.Boolean

    true if this is matches double click criteria; otherwise, false.

    IsNotSet(Int32, Int32)

    Determines whether none of the the specified flags is set.

    Declaration
    public static bool IsNotSet(int value, int flags)
    Parameters
    Type Name Description
    System.Int32 value

    The value.

    System.Int32 flags

    The flags.

    Returns
    Type Description
    System.Boolean

    true if none of the the specified flags is set; otherwise, false.

    IsObjectDescendantOfParent(DependencyObject, DependencyObject)

    Determines whether a given object is a descendant of a parent in the visual or logical tree.

    Declaration
    public static bool IsObjectDescendantOfParent(DependencyObject parent, DependencyObject obj)
    Parameters
    Type Name Description
    System.Windows.DependencyObject parent

    The parent object to be tested.

    System.Windows.DependencyObject obj

    The descendant object to be tested.

    Returns
    Type
    System.Boolean

    IsSet(Int32, Int32)

    Determines whether any of the specified flags are set.

    Declaration
    public static bool IsSet(int value, int flags)
    Parameters
    Type Name Description
    System.Int32 value

    The value.

    System.Int32 flags

    The flags.

    Returns
    Type Description
    System.Boolean

    true if the specified value is set; otherwise, false.

    Max(Point, Point)

    Returns the point with larger value for X and Y coordinates each of two points.

    Declaration
    public static Point Max(Point point1, Point point2)
    Parameters
    Type Name Description
    System.Windows.Point point1

    The first point to compare.

    System.Windows.Point point2

    The second point to compare.

    Returns
    Type Description
    System.Windows.Point

    The point with larger value for X and Y coordinates each of two points.

    Max(Size, Size)

    Returns the size with larger value for Width and Height coordinates for each of two values.

    Declaration
    public static Size Max(Size size1, Size size2)
    Parameters
    Type Name Description
    System.Windows.Size size1

    The first size to compare.

    System.Windows.Size size2

    The second size to compare.

    Returns
    Type Description
    System.Windows.Size

    The size with larger value for Width and Height coordinates for each of two values.

    Min(Point, Point)

    Returns the point with smaller value for X and Y coordinates each of two points.

    Declaration
    public static Point Min(Point point1, Point point2)
    Parameters
    Type Name Description
    System.Windows.Point point1

    The first point to compare.

    System.Windows.Point point2

    The second point to compare.

    Returns
    Type Description
    System.Windows.Point

    The point with smaller value for X and Y coordinates each of two points

    Min(Size, Size)

    Returns the size with smaller value for Width and Height coordinates for each of two values.

    Declaration
    public static Size Min(Size size1, Size size2)
    Parameters
    Type Name Description
    System.Windows.Size size1

    The first size to compare.

    System.Windows.Size size2

    The second size to compare.

    Returns
    Type Description
    System.Windows.Size

    The size with smaller value for Width and Height coordinates for each of two values.

    MinMax(Double, Double, Double)

    Returns the value not smaller and not larger than a specified range.

    Declaration
    public static double MinMax(double value, double min, double max)
    Parameters
    Type Name Description
    System.Double value

    The value to compare.

    System.Double min

    The smallest value.

    System.Double max

    The largest value.

    Returns
    Type Description
    System.Double

    The value not smaller than min and and not larger than max.

    MinMax(Int32, Int32, Int32)

    Returns the value not smaller and not larger than a specified range.

    Declaration
    public static int MinMax(int value, int min, int max)
    Parameters
    Type Name Description
    System.Int32 value

    The value to compare.

    System.Int32 min

    The smallest value.

    System.Int32 max

    The largest value.

    Returns
    Type Description
    System.Int32

    The value not smaller than min and and not larger than max.

    MinMax(Single, Single, Single)

    Returns the value not smaller and not larger than a specified range.

    Declaration
    public static float MinMax(float value, float min, float max)
    Parameters
    Type Name Description
    System.Single value

    The value to compare.

    System.Single min

    The smallest value.

    System.Single max

    The largest value.

    Returns
    Type Description
    System.Single

    The value not smaller than min and and not larger than max.

    MinMax(Point, Point, Point)

    Returns the value not smaller and not larger than a specified range.

    Declaration
    public static Point MinMax(Point point, Point min, Point max)
    Parameters
    Type Name Description
    System.Windows.Point point

    The value to compare.

    System.Windows.Point min

    The smallest value.

    System.Windows.Point max

    The largest value.

    Returns
    Type Description
    System.Windows.Point

    The value not smaller than min and and not larger than max.

    Remarks

    The calculation is made for both the X and Y coordinates separately.

    MinMax(Point, Rect)

    Returns the value not smaller and not larger than a specified range.

    Declaration
    public static Point MinMax(Point point, Rect bounds)
    Parameters
    Type Name Description
    System.Windows.Point point

    The value to compare.

    System.Windows.Rect bounds

    The rectangle with bounds.

    Returns
    Type Description
    System.Windows.Point

    The value not smaller than min and and not larger than max.

    Remarks

    The calculation is made for both the X and Y coordinates separately and compared with the rectangles boundaries.

    PushClip(DrawingContext, Rect)

    Pushes the clip.

    Declaration
    public static void PushClip(DrawingContext dc, Rect clipRect)
    Parameters
    Type Name Description
    System.Windows.Media.DrawingContext dc

    The dc.

    System.Windows.Rect clipRect

    The clip rect.

    SetCanvasBounds(UIElement, Rect)

    Sets the canvas Left, Top, Right and Bottom attached properties.

    Declaration
    public static void SetCanvasBounds(UIElement el, Rect rect)
    Parameters
    Type Name Description
    System.Windows.UIElement el

    The element for which to set the attached properties.

    System.Windows.Rect rect

    The rect.

    SetClipRect(DrawingVisual, Rect)

    Sets the clip rect.

    Declaration
    public static RectangleGeometry SetClipRect(DrawingVisual dv, Rect r)
    Parameters
    Type Name Description
    System.Windows.Media.DrawingVisual dv

    The DrawingVisual.

    System.Windows.Rect r

    The clip recangle.

    Returns
    Type
    System.Windows.Media.RectangleGeometry

    SetClipRect(UIElement, Rect)

    Sets the clip rect.

    Declaration
    public static RectangleGeometry SetClipRect(UIElement el, Rect r)
    Parameters
    Type Name Description
    System.Windows.UIElement el

    The element.

    System.Windows.Rect r

    The clip recangle.

    Returns
    Type
    System.Windows.Media.RectangleGeometry
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved