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
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
DpiX
Gets the system horizontal dots per inch (dpi).
public static double DpiX { get; }
Property Value
DpiY
Gets the system vertical dots per inch (dpi).
public static double DpiY { get; }
Property Value
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 isfalse
.
Methods
EnsureAccess(MethodBase)
Ensures the calling thread is the thread associated with the Dispatcher.
public static bool EnsureAccess(MethodBase method)
Parameters
method
MethodBaseThe method.
Returns
EnsureAccess(MethodBase, object)
Ensures the calling thread is the thread associated with the Dispatcher.
public static bool EnsureAccess(MethodBase method, object o)
Parameters
method
MethodBaseThe method.
o
objectThe object.
Returns
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
MethodBaseThe method.
o
objectThe object.
parameters
object[]The parameters.
Returns
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
MethodBaseThe method.
parameters
object[]The parameters.
Returns
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
DispatcherThe dispatcher.
method
MethodBaseThe method.
o
objectThe object.
parameters
object[]The parameters.
Returns
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
DispatcherObjectThe object.
method
MethodBaseThe method.
parameters
object[]The parameters.
Returns
FindLogicalAncestor(DependencyObject, Predicate<DependencyObject>)
Finds the logical ancestor according to the predicate.
public static DependencyObject FindLogicalAncestor(this DependencyObject startElement, Predicate<DependencyObject> condition)
Parameters
startElement
DependencyObjectThe start element.
condition
Predicate<DependencyObject>The condition.
Returns
FindLogicalAncestorByType<T>(DependencyObject)
Finds the logical ancestor by type.
public static T FindLogicalAncestorByType<T>(this DependencyObject startElement) where T : DependencyObject
Parameters
startElement
DependencyObjectThe start element.
Returns
- T
Type Parameters
T
FindLogicalRoot(DependencyObject)
Finds the logical root.
public static DependencyObject FindLogicalRoot(this DependencyObject startElement)
Parameters
startElement
DependencyObjectThe start element.
Returns
FindVisualAncestor(DependencyObject, Predicate<DependencyObject>)
Finds the visual ancestor according to the predicate.
public static DependencyObject FindVisualAncestor(this DependencyObject startElement, Predicate<DependencyObject> condition)
Parameters
startElement
DependencyObjectThe start element.
condition
Predicate<DependencyObject>The condition.
Returns
FindVisualAncestorByType<T>(DependencyObject)
Finds the visual ancestor by type.
public static T FindVisualAncestorByType<T>(this DependencyObject startElement) where T : DependencyObject
Parameters
startElement
DependencyObjectThe 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
DependencyObjectThe start element.
condition
Predicate<DependencyObject>The condition.
Returns
FindVisualDescendantByType<T>(DependencyObject)
Finds the visual descendant by type.
public static T FindVisualDescendantByType<T>(this DependencyObject startElement) where T : DependencyObject
Parameters
startElement
DependencyObjectThe start element.
Returns
- T
Type Parameters
T
FindVisualRoot(DependencyObject)
Finds the visual root.
public static DependencyObject FindVisualRoot(this DependencyObject startElement)
Parameters
startElement
DependencyObjectThe start element.
Returns
GetItemContainers(ItemsControl)
Gets the generated containers of all items in an ItemsControl.
public static IEnumerable<DependencyObject> GetItemContainers(this ItemsControl itemsControl)
Parameters
itemsControl
ItemsControlThe items control.
Returns
GetVisualChildren(Visual)
Gets the visual children.
public static IEnumerable<Visual> GetVisualChildren(this Visual parent)
Parameters
parent
VisualThe parent.
Returns
LaunchBrowser(Uri)
Launches the browser.
public static void LaunchBrowser(Uri uri)
Parameters
uri
UriThe URI.