C# Class BaseWPFHelpers.Helpers

Show file Open project: Gainedge/BetterExplorer

Public Methods

Method Description
CreateImageBrushFromVisual ( FrameworkElement element ) : System.Windows.Media.Imaging.RenderTargetBitmap

Helper method to create a snapshot of a visual item as a bitmap image. Typically used for things like drag and drop or any time we want to do something where we don't want the hit of a video running in an animating object

FindDownInTree ( Visual parent, IFinderMatchVisualHelper helper ) : List

Walker that looks down in the visual tree for any matching elements, typically used with Type

FindDownInTree ( List lst, DependencyObject parent, DependencyObject ignore, IFinderMatchVisualHelper helper ) : void

Really a helper for FindDownInTree, typically not called directly.

FindElementOfType ( Visual parent, Type ty ) : FrameworkElement

Simple form call that returns the first element of a given type down in the visual tree

FindElementOfTypeUp ( Visual parent, Type ty ) : FrameworkElement

Simple form call that returns the first element of a given type up in the visual tree

FindElementsOfType ( Visual parent, Type ty ) : List

Simple form call that returns all elements of a given type down in the visual tree

FindFocusedElement ( Visual parent ) : FrameworkElement

Helper to find the currently focused element

FindInTree ( Visual parent, IFinderMatchVisualHelper helper ) : List

Walker that looks both UP and down in the visual tree for any matching elements, typically used with Type

FindItemsHost ( Visual parent ) : FrameworkElement

Helper to find a items host (e.g. in a listbox etc) down in the tree

FindUpInTree ( List lst, Visual parent, Visual ignore, IFinderMatchVisualHelper helper ) : void

Really a helper to look Up in a tree, typically not called directly.

FindVisualElement ( Visual parent, String ElementName ) : FrameworkElement

Helper to find the given named element down in the visual tree

FindVisualElementUp ( Visual parent, String ElementName ) : FrameworkElement

Helper to find the given named element up in the visual tree

SingleFindDownInTree ( Visual parent, IFinderMatchVisualHelper helper ) : FrameworkElement

Typically used method that walks down the visual tree from a given point to locate a given match only once. Typically used with Name/ItemHost etc type matching. Only returns one element

SingleFindInTree ( Visual parent, IFinderMatchVisualHelper helper ) : FrameworkElement

All way visual tree helper that searches UP and DOWN in a tree for the matching pattern. This is used to walk for name matches or type matches typically. Returns only the first matching element

TurnOffMediaElements ( Visual parent ) : void

Helper to pause any media elements down in the visual tree

TurnOnMediaElements ( Visual parent ) : void

Helper to resume playing any media elements down in the visual tree

Method Details

CreateImageBrushFromVisual() public static method

Helper method to create a snapshot of a visual item as a bitmap image. Typically used for things like drag and drop or any time we want to do something where we don't want the hit of a video running in an animating object
public static CreateImageBrushFromVisual ( FrameworkElement element ) : System.Windows.Media.Imaging.RenderTargetBitmap
element System.Windows.FrameworkElement Element to take a snapshot of
return System.Windows.Media.Imaging.RenderTargetBitmap

FindDownInTree() public static method

Walker that looks down in the visual tree for any matching elements, typically used with Type
public static FindDownInTree ( Visual parent, IFinderMatchVisualHelper helper ) : List
parent Visual Start point in the tree to search
helper IFinderMatchVisualHelper Match Helper to use
return List

FindDownInTree() public static method

Really a helper for FindDownInTree, typically not called directly.
public static FindDownInTree ( List lst, DependencyObject parent, DependencyObject ignore, IFinderMatchVisualHelper helper ) : void
lst List
parent System.Windows.DependencyObject
ignore System.Windows.DependencyObject
helper IFinderMatchVisualHelper
return void

FindElementOfType() public static method

Simple form call that returns the first element of a given type down in the visual tree
public static FindElementOfType ( Visual parent, Type ty ) : FrameworkElement
parent Visual
ty System.Type
return System.Windows.FrameworkElement

FindElementOfTypeUp() public static method

Simple form call that returns the first element of a given type up in the visual tree
public static FindElementOfTypeUp ( Visual parent, Type ty ) : FrameworkElement
parent Visual
ty System.Type
return System.Windows.FrameworkElement

FindElementsOfType() public static method

Simple form call that returns all elements of a given type down in the visual tree
public static FindElementsOfType ( Visual parent, Type ty ) : List
parent Visual
ty System.Type
return List

FindFocusedElement() public static method

Helper to find the currently focused element
public static FindFocusedElement ( Visual parent ) : FrameworkElement
parent Visual
return System.Windows.FrameworkElement

FindInTree() public static method

Walker that looks both UP and down in the visual tree for any matching elements, typically used with Type
public static FindInTree ( Visual parent, IFinderMatchVisualHelper helper ) : List
parent Visual Start point in the tree to search
helper IFinderMatchVisualHelper Match Helper to use
return List

FindItemsHost() public static method

Helper to find a items host (e.g. in a listbox etc) down in the tree
public static FindItemsHost ( Visual parent ) : FrameworkElement
parent Visual
return System.Windows.FrameworkElement

FindUpInTree() public static method

Really a helper to look Up in a tree, typically not called directly.
public static FindUpInTree ( List lst, Visual parent, Visual ignore, IFinderMatchVisualHelper helper ) : void
lst List
parent Visual
ignore Visual
helper IFinderMatchVisualHelper
return void

FindVisualElement() public static method

Helper to find the given named element down in the visual tree
public static FindVisualElement ( Visual parent, String ElementName ) : FrameworkElement
parent Visual
ElementName String
return System.Windows.FrameworkElement

FindVisualElementUp() public static method

Helper to find the given named element up in the visual tree
public static FindVisualElementUp ( Visual parent, String ElementName ) : FrameworkElement
parent Visual
ElementName String
return System.Windows.FrameworkElement

SingleFindDownInTree() public static method

Typically used method that walks down the visual tree from a given point to locate a given match only once. Typically used with Name/ItemHost etc type matching. Only returns one element
public static SingleFindDownInTree ( Visual parent, IFinderMatchVisualHelper helper ) : FrameworkElement
parent Visual Start point in the tree to search
helper IFinderMatchVisualHelper Match Helper to use
return System.Windows.FrameworkElement

SingleFindInTree() public static method

All way visual tree helper that searches UP and DOWN in a tree for the matching pattern. This is used to walk for name matches or type matches typically. Returns only the first matching element
public static SingleFindInTree ( Visual parent, IFinderMatchVisualHelper helper ) : FrameworkElement
parent Visual Start point in the tree to search
helper IFinderMatchVisualHelper Match Helper to use
return System.Windows.FrameworkElement

TurnOffMediaElements() public static method

Helper to pause any media elements down in the visual tree
public static TurnOffMediaElements ( Visual parent ) : void
parent Visual
return void

TurnOnMediaElements() public static method

Helper to resume playing any media elements down in the visual tree
public static TurnOnMediaElements ( Visual parent ) : void
parent Visual
return void