Class ElementExtention
public static class ElementExtention
- Inheritance
-
ElementExtention
- Inherited Members
Methods
AddAdorner(UIElement, Adorner)
public static bool AddAdorner(this UIElement element, Adorner adorner)
Parameters
Returns
Ancestors(DependencyObject)
public static IEnumerable<DependencyObject> Ancestors(this DependencyObject dependencyObject)
Parameters
dependencyObject
DependencyObject
Returns
AncestorsAndSelf(DependencyObject)
public static IEnumerable<DependencyObject> AncestorsAndSelf(this DependencyObject dependencyObject)
Parameters
dependencyObject
DependencyObject
Returns
BeginAnimationAngle(UIElement, double, double)
public static void BeginAnimationAngle(this UIElement element, double toAngle, double duration = 1000)
Parameters
BeginAnimationAngle(UIElement, double, double, double, Action<UIElement>, Action<StoryboardEngineBase>)
public static StoryboardEngineBase BeginAnimationAngle(this UIElement element, double from, double to, double duration = 1000, Action<UIElement> Completed = null, Action<StoryboardEngineBase> init = null)
Parameters
element
UIElementfrom
doubleto
doubleduration
doubleCompleted
Action<UIElement>init
Action<StoryboardEngineBase>
Returns
BeginAnimationOpacity(UIElement, double, double)
public static void BeginAnimationOpacity(this UIElement element, double to, double duration = 1000)
Parameters
BeginAnimationOpacity(UIElement, double, double, double, Action<UIElement>, Action<StoryboardEngineBase>)
public static StoryboardEngineBase BeginAnimationOpacity(this UIElement element, double from, double to, double duration = 1000, Action<UIElement> Completed = null, Action<StoryboardEngineBase> init = null)
Parameters
element
UIElementfrom
doubleto
doubleduration
doubleCompleted
Action<UIElement>init
Action<StoryboardEngineBase>
Returns
BeginAnimationPath(UIElement, PathGeometry, double, bool, bool)
public static void BeginAnimationPath(this UIElement element, PathGeometry geometry, double duration = 1000, bool useAngle = true, bool reverse = false)
Parameters
element
UIElementgeometry
PathGeometryduration
doubleuseAngle
boolreverse
bool
BeginAnimationScale(UIElement, double, double, double)
public static void BeginAnimationScale(this UIElement element, double scaleX, double scaleY, double duration = 1000)
Parameters
BeginAnimationScaleX(UIElement, double, double, double, Action<UIElement>, Action<StoryboardEngineBase>)
public static StoryboardEngineBase BeginAnimationScaleX(this UIElement element, double from, double to, double duration = 1000, Action<UIElement> Completed = null, Action<StoryboardEngineBase> init = null)
Parameters
element
UIElementfrom
doubleto
doubleduration
doubleCompleted
Action<UIElement>init
Action<StoryboardEngineBase>
Returns
BeginAnimationScaleY(UIElement, double, double, double, Action<UIElement>, Action<StoryboardEngineBase>)
public static StoryboardEngineBase BeginAnimationScaleY(this UIElement element, double from, double to, double duration = 1000, Action<UIElement> Completed = null, Action<StoryboardEngineBase> init = null)
Parameters
element
UIElementfrom
doubleto
doubleduration
doubleCompleted
Action<UIElement>init
Action<StoryboardEngineBase>
Returns
BeginAnimationSkew(UIElement, double, double, double)
public static void BeginAnimationSkew(this UIElement element, double toAngleX, double toAngleY, double duration = 1000)
Parameters
BeginAnimationSkewX(UIElement, double, double, double, Action<UIElement>, Action<StoryboardEngineBase>)
public static StoryboardEngineBase BeginAnimationSkewX(this UIElement element, double from, double to, double duration = 1000, Action<UIElement> Completed = null, Action<StoryboardEngineBase> init = null)
Parameters
element
UIElementfrom
doubleto
doubleduration
doubleCompleted
Action<UIElement>init
Action<StoryboardEngineBase>
Returns
BeginAnimationSkewY(UIElement, double, double, double, Action<UIElement>, Action<StoryboardEngineBase>)
public static void BeginAnimationSkewY(this UIElement element, double from, double to, double duration = 1000, Action<UIElement> Completed = null, Action<StoryboardEngineBase> init = null)
Parameters
element
UIElementfrom
doubleto
doubleduration
doubleCompleted
Action<UIElement>init
Action<StoryboardEngineBase>
BeginAnimationX(UIElement, double, double, double, Action<UIElement>, Action<StoryboardEngineBase>)
public static StoryboardEngineBase BeginAnimationX(this UIElement element, double from, double to, double duration = 1000, Action<UIElement> Completed = null, Action<StoryboardEngineBase> init = null)
Parameters
element
UIElementfrom
doubleto
doubleduration
doubleCompleted
Action<UIElement>init
Action<StoryboardEngineBase>
Returns
BeginAnimationXY(UIElement, double, double, double)
public static void BeginAnimationXY(this UIElement element, double toX, double toY, double duration = 1000)
Parameters
BeginAnimationY(UIElement, double, double, double, Action<UIElement>, Action<StoryboardEngineBase>)
public static StoryboardEngineBase BeginAnimationY(this UIElement element, double from, double to, double duration = 1000, Action<UIElement> Completed = null, Action<StoryboardEngineBase> init = null)
Parameters
element
UIElementfrom
doubleto
doubleduration
doubleCompleted
Action<UIElement>init
Action<StoryboardEngineBase>
Returns
BegionDoubleStoryBoard(UIElement, double, double, double, string, Action<UIElement>, Action<StoryboardEngineBase>)
执行动画
public static StoryboardEngineBase BegionDoubleStoryBoard(this UIElement element, double start, double end, double duration, string propertyName, Action<UIElement> Completed = null, Action<StoryboardEngineBase> init = null)
Parameters
element
UIElementstart
doubleend
doubleduration
doublepropertyName
stringCompleted
Action<UIElement>init
Action<StoryboardEngineBase>
Returns
BindCommand(UIElement, ICommand)
public static void BindCommand(this UIElement ui, ICommand com)
Parameters
BindCommand(UIElement, ICommand, Action<object, ExecutedRoutedEventArgs>)
public static void BindCommand(this UIElement ui, ICommand com, Action<object, ExecutedRoutedEventArgs> call)
Parameters
ui
UIElementcom
ICommandcall
Action<object, ExecutedRoutedEventArgs>
CheckDefaultTransformGroup(UIElement)
public static bool CheckDefaultTransformGroup(this UIElement element)
Parameters
element
UIElement
Returns
ClearAdorner(UIElement, Predicate<Adorner>)
public static bool ClearAdorner(this UIElement element, Predicate<Adorner> predicate = null)
Parameters
Returns
Collapsed(UIElement)
public static void Collapsed(this UIElement ui)
Parameters
ui
UIElement
FindAllVisualChild<T>(DependencyObject, Predicate<T>)
public static IEnumerable<T> FindAllVisualChild<T>(this DependencyObject obj, Predicate<T> match) where T : DependencyObject
Parameters
obj
DependencyObjectmatch
Predicate<T>
Returns
- IEnumerable<T>
Type Parameters
T
GetAdorner(UIElement, Predicate<Adorner>)
public static Adorner GetAdorner(this UIElement element, Predicate<Adorner> predicate = null)
Parameters
Returns
GetAdorners(UIElement, Predicate<Adorner>)
public static IEnumerable<Adorner> GetAdorners(this UIElement element, Predicate<Adorner> predicate = null)
Parameters
Returns
GetChild<T>(DependencyObject, Func<T, bool>)
public static T GetChild<T>(this DependencyObject p_element, Func<T, bool> p_func = null) where T : UIElement
Parameters
p_element
DependencyObjectp_func
Func<T, bool>
Returns
- T
Type Parameters
T
GetChildren<T>(DependencyObject, Func<T, bool>, bool)
public static IEnumerable<T> GetChildren<T>(this DependencyObject p_element, Func<T, bool> p_func = null, bool filterContain = false) where T : UIElement
Parameters
p_element
DependencyObjectp_func
Func<T, bool>filterContain
bool
Returns
- IEnumerable<T>
Type Parameters
T
GetContent(UIElement)
public static object GetContent(this UIElement element)
Parameters
element
UIElement
Returns
GetDataContext(UIElement)
public static object GetDataContext(this UIElement element)
Parameters
element
UIElement
Returns
GetElement<T>(DependencyObject)
public static T GetElement<T>(this DependencyObject element) where T : FrameworkElement
Parameters
element
DependencyObject
Returns
- T
Type Parameters
T
GetElements<T>(DependencyObject)
public static IEnumerable<T> GetElements<T>(this DependencyObject element) where T : FrameworkElement
Parameters
element
DependencyObject
Returns
- IEnumerable<T>
Type Parameters
T
GetImage(UIElement)
public static BitmapSource GetImage(this UIElement element)
Parameters
element
UIElement
Returns
GetImplementationRoot(DependencyObject)
public static FrameworkElement GetImplementationRoot(this DependencyObject d)
Parameters
Returns
GetItemsSource<T>(UIElement)
public static T GetItemsSource<T>(this UIElement element) where T : IEnumerable
Parameters
element
UIElement
Returns
- T
Type Parameters
T
GetParent(DependencyObject)
public static DependencyObject GetParent(this DependencyObject dependencyObject)
Parameters
dependencyObject
DependencyObject
Returns
GetParent(DependencyObject, Type)
public static DependencyObject GetParent(this DependencyObject fe, Type lookForType)
Parameters
fe
DependencyObjectlookForType
Type
Returns
GetParent<T>(DependencyObject)
public static T GetParent<T>(this DependencyObject element) where T : DependencyObject
Parameters
element
DependencyObject
Returns
- T
Type Parameters
T
GetParent<T>(DependencyObject, Func<T, bool>)
public static T GetParent<T>(this DependencyObject element, Func<T, bool> p_func) where T : DependencyObject
Parameters
element
DependencyObjectp_func
Func<T, bool>
Returns
- T
Type Parameters
T
GetTemplateByName<T>(Control, string)
public static T GetTemplateByName<T>(this Control control, string name) where T : FrameworkElement
Parameters
Returns
- T
Type Parameters
T
GetTransform<T>(UIElement)
获取 RenderTransform 中 Transform 元素
public static T GetTransform<T>(this UIElement element) where T : Transform
Parameters
element
UIElement
Returns
- T
Type Parameters
T
GetValueSync<T>(DependencyObject, DependencyProperty)
public static T GetValueSync<T>(this DependencyObject obj, DependencyProperty property)
Parameters
obj
DependencyObjectproperty
DependencyProperty
Returns
- T
Type Parameters
T
Hidden(UIElement)
public static void Hidden(this UIElement ui)
Parameters
ui
UIElement
HitTest<T>(UIElement, Geometry, Predicate<T>)
public static T HitTest<T>(this UIElement element, Geometry geometry, Predicate<T> predicate = null) where T : DependencyObject
Parameters
Returns
- T
Type Parameters
T
HitTest<T>(UIElement, Point)
public static T HitTest<T>(this UIElement element, Point point) where T : DependencyObject
Parameters
Returns
- T
Type Parameters
T
HitTest<T>(UIElement, Point, Predicate<T>)
public static T HitTest<T>(this UIElement element, Point point, Predicate<T> predicate = null) where T : DependencyObject
Parameters
Returns
- T
Type Parameters
T
PrintLogicalTree(DependencyObject)
public static IEnumerable<DependencyObject> PrintLogicalTree(this DependencyObject obj)
Parameters
obj
DependencyObject
Returns
PrintVisualTree(DependencyObject)
public static IEnumerable<DependencyObject> PrintVisualTree(this DependencyObject obj)
Parameters
obj
DependencyObject
Returns
SetValueSync<T>(DependencyObject, DependencyProperty, T)
public static void SetValueSync<T>(this DependencyObject obj, DependencyProperty property, T value)
Parameters
obj
DependencyObjectproperty
DependencyPropertyvalue
T
Type Parameters
T
TryGetVisualStateGroup(DependencyObject, string)
public static VisualStateGroup TryGetVisualStateGroup(this DependencyObject d, string groupName)
Parameters
d
DependencyObjectgroupName
string
Returns
VisibilityWith(UIElement, bool)
public static void VisibilityWith(this UIElement ui, bool from)
Parameters
Visible(UIElement)
public static void Visible(this UIElement ui)
Parameters
ui
UIElement
Wait(UIElement, double, Action<UIElement>)
public static void Wait(this UIElement element, double duration = 1000, Action<UIElement> Completed = null)