Table of Contents

Class UIHelpers

Namespace
HeBianGu.General.WpfControlLib
Assembly
HeBianGu.General.WpfControlLib.dll

Encapsulates methods for manipulation of the visual tree.

public static class UIHelpers
Inheritance
UIHelpers
Inherited Members

Properties

DpiTransformFromDevice

Gets a matrix that transforms the coordinates of the device that is associated with the rendering destination of this target.

public static Matrix DpiTransformFromDevice { get; }

Property Value

Matrix

DpiTransformToDevice

Gets a matrix that transforms the coordinates of this target to the device that is associated with the rendering destination.

public static Matrix DpiTransformToDevice { get; }

Property Value

Matrix

DpiX

Gets the system horizontal dots per inch (dpi).

public static double DpiX { get; }

Property Value

double

DpiY

Gets the system vertical dots per inch (dpi).

public static double DpiY { get; }

Property Value

double

IsAutomaticBrowserLaunchEnabled

Gets or sets a value indicating whether clicking a Hyperlink that has a URI automatically launches the browser.

public static bool IsAutomaticBrowserLaunchEnabled { get; set; }

Property Value

bool

true if the browser is launched automatically; otherwise, false. The default is false.

Methods

EnsureAccess(MethodBase)

Ensures the calling thread is the thread associated with the Dispatcher.

public static bool EnsureAccess(MethodBase method)

Parameters

method MethodBase

The method.

Returns

bool

EnsureAccess(MethodBase, object)

Ensures the calling thread is the thread associated with the Dispatcher.

public static bool EnsureAccess(MethodBase method, object o)

Parameters

method MethodBase

The method.

o object

The object.

Returns

bool

EnsureAccess(MethodBase, object, params object[])

Ensures the calling thread is the thread associated with the Dispatcher.

public static bool EnsureAccess(MethodBase method, object o, params object[] parameters)

Parameters

method MethodBase

The method.

o object

The object.

parameters object[]

The parameters.

Returns

bool

EnsureAccess(MethodBase, params object[])

Ensures the calling thread is the thread associated with the Dispatcher.

public static bool EnsureAccess(MethodBase method, params object[] parameters)

Parameters

method MethodBase

The method.

parameters object[]

The parameters.

Returns

bool

EnsureAccess(Dispatcher, MethodBase, object, params object[])

Ensures the calling thread is the thread associated with the Dispatcher.

public static bool EnsureAccess(Dispatcher dispatcher, MethodBase method, object o, params object[] parameters)

Parameters

dispatcher Dispatcher

The dispatcher.

method MethodBase

The method.

o object

The object.

parameters object[]

The parameters.

Returns

bool

EnsureAccess(DispatcherObject, MethodBase, params object[])

Ensures the calling thread is the thread associated with the Dispatcher.

public static bool EnsureAccess(this DispatcherObject o, MethodBase method, params object[] parameters)

Parameters

o DispatcherObject

The object.

method MethodBase

The method.

parameters object[]

The parameters.

Returns

bool

FindLogicalAncestor(DependencyObject, Predicate<DependencyObject>)

Finds the logical ancestor according to the predicate.

public static DependencyObject FindLogicalAncestor(this DependencyObject startElement, Predicate<DependencyObject> condition)

Parameters

startElement DependencyObject

The start element.

condition Predicate<DependencyObject>

The condition.

Returns

DependencyObject

FindLogicalAncestorByType<T>(DependencyObject)

Finds the logical ancestor by type.

public static T FindLogicalAncestorByType<T>(this DependencyObject startElement) where T : DependencyObject

Parameters

startElement DependencyObject

The start element.

Returns

T

Type Parameters

T

FindLogicalRoot(DependencyObject)

Finds the logical root.

public static DependencyObject FindLogicalRoot(this DependencyObject startElement)

Parameters

startElement DependencyObject

The start element.

Returns

DependencyObject

FindVisualAncestor(DependencyObject, Predicate<DependencyObject>)

Finds the visual ancestor according to the predicate.

public static DependencyObject FindVisualAncestor(this DependencyObject startElement, Predicate<DependencyObject> condition)

Parameters

startElement DependencyObject

The start element.

condition Predicate<DependencyObject>

The condition.

Returns

DependencyObject

FindVisualAncestorByType<T>(DependencyObject)

Finds the visual ancestor by type.

public static T FindVisualAncestorByType<T>(this DependencyObject startElement) where T : DependencyObject

Parameters

startElement DependencyObject

The start element.

Returns

T

Type Parameters

T

FindVisualDescendant(DependencyObject, Predicate<DependencyObject>)

Finds the visual descendant.

public static DependencyObject FindVisualDescendant(this DependencyObject startElement, Predicate<DependencyObject> condition)

Parameters

startElement DependencyObject

The start element.

condition Predicate<DependencyObject>

The condition.

Returns

DependencyObject

FindVisualDescendantByType<T>(DependencyObject)

Finds the visual descendant by type.

public static T FindVisualDescendantByType<T>(this DependencyObject startElement) where T : DependencyObject

Parameters

startElement DependencyObject

The start element.

Returns

T

Type Parameters

T

FindVisualRoot(DependencyObject)

Finds the visual root.

public static DependencyObject FindVisualRoot(this DependencyObject startElement)

Parameters

startElement DependencyObject

The start element.

Returns

DependencyObject

GetItemContainers(ItemsControl)

Gets the generated containers of all items in an ItemsControl.

public static IEnumerable<DependencyObject> GetItemContainers(this ItemsControl itemsControl)

Parameters

itemsControl ItemsControl

The items control.

Returns

IEnumerable<DependencyObject>

GetVisualChildren(Visual)

Gets the visual children.

public static IEnumerable<Visual> GetVisualChildren(this Visual parent)

Parameters

parent Visual

The parent.

Returns

IEnumerable<Visual>

LaunchBrowser(Uri)

Launches the browser. Provides accidental click flood protection.

public static void LaunchBrowser(Uri uri)

Parameters

uri Uri

The URI.