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
dependencyObjectDependencyObject
Returns
AncestorsAndSelf(DependencyObject)
public static IEnumerable<DependencyObject> AncestorsAndSelf(this DependencyObject dependencyObject)
Parameters
dependencyObjectDependencyObject
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
elementUIElementfromdoubletodoubledurationdoubleCompletedAction<UIElement>initAction<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
elementUIElementfromdoubletodoubledurationdoubleCompletedAction<UIElement>initAction<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
elementUIElementgeometryPathGeometrydurationdoubleuseAngleboolreversebool
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
elementUIElementfromdoubletodoubledurationdoubleCompletedAction<UIElement>initAction<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
elementUIElementfromdoubletodoubledurationdoubleCompletedAction<UIElement>initAction<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
elementUIElementfromdoubletodoubledurationdoubleCompletedAction<UIElement>initAction<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
elementUIElementfromdoubletodoubledurationdoubleCompletedAction<UIElement>initAction<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
elementUIElementfromdoubletodoubledurationdoubleCompletedAction<UIElement>initAction<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
elementUIElementfromdoubletodoubledurationdoubleCompletedAction<UIElement>initAction<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
elementUIElementstartdoubleenddoubledurationdoublepropertyNamestringCompletedAction<UIElement>initAction<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
uiUIElementcomICommandcallAction<object, ExecutedRoutedEventArgs>
CheckDefaultTransformGroup(UIElement)
public static bool CheckDefaultTransformGroup(this UIElement element)
Parameters
elementUIElement
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
uiUIElement
FindAllVisualChild<T>(DependencyObject, Predicate<T>)
public static IEnumerable<T> FindAllVisualChild<T>(this DependencyObject obj, Predicate<T> match) where T : DependencyObject
Parameters
objDependencyObjectmatchPredicate<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_elementDependencyObjectp_funcFunc<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_elementDependencyObjectp_funcFunc<T, bool>filterContainbool
Returns
- IEnumerable<T>
Type Parameters
T
GetContent(UIElement)
public static object GetContent(this UIElement element)
Parameters
elementUIElement
Returns
GetDataContext(UIElement)
public static object GetDataContext(this UIElement element)
Parameters
elementUIElement
Returns
GetElement<T>(DependencyObject)
public static T GetElement<T>(this DependencyObject element) where T : FrameworkElement
Parameters
elementDependencyObject
Returns
- T
Type Parameters
T
GetElements<T>(DependencyObject)
public static IEnumerable<T> GetElements<T>(this DependencyObject element) where T : FrameworkElement
Parameters
elementDependencyObject
Returns
- IEnumerable<T>
Type Parameters
T
GetImage(UIElement)
public static BitmapSource GetImage(this UIElement element)
Parameters
elementUIElement
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
elementUIElement
Returns
- T
Type Parameters
T
GetParent(DependencyObject)
public static DependencyObject GetParent(this DependencyObject dependencyObject)
Parameters
dependencyObjectDependencyObject
Returns
GetParent(DependencyObject, Type)
public static DependencyObject GetParent(this DependencyObject fe, Type lookForType)
Parameters
feDependencyObjectlookForTypeType
Returns
GetParent<T>(DependencyObject)
public static T GetParent<T>(this DependencyObject element) where T : DependencyObject
Parameters
elementDependencyObject
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
elementDependencyObjectp_funcFunc<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
elementUIElement
Returns
- T
Type Parameters
T
GetValueSync<T>(DependencyObject, DependencyProperty)
public static T GetValueSync<T>(this DependencyObject obj, DependencyProperty property)
Parameters
objDependencyObjectpropertyDependencyProperty
Returns
- T
Type Parameters
T
Hidden(UIElement)
public static void Hidden(this UIElement ui)
Parameters
uiUIElement
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
objDependencyObject
Returns
PrintVisualTree(DependencyObject)
public static IEnumerable<DependencyObject> PrintVisualTree(this DependencyObject obj)
Parameters
objDependencyObject
Returns
SetValueSync<T>(DependencyObject, DependencyProperty, T)
public static void SetValueSync<T>(this DependencyObject obj, DependencyProperty property, T value)
Parameters
objDependencyObjectpropertyDependencyPropertyvalueT
Type Parameters
T
TryGetVisualStateGroup(DependencyObject, string)
public static VisualStateGroup TryGetVisualStateGroup(this DependencyObject d, string groupName)
Parameters
dDependencyObjectgroupNamestring
Returns
VisibilityWith(UIElement, bool)
public static void VisibilityWith(this UIElement ui, bool from)
Parameters
Visible(UIElement)
public static void Visible(this UIElement ui)
Parameters
uiUIElement
Wait(UIElement, double, Action<UIElement>)
public static void Wait(this UIElement element, double duration = 1000, Action<UIElement> Completed = null)