private ElementStateMode FindMode(DependencyObject element) { ElementStateMode mode = GetMode(element); if (mode != ElementStateMode.Default) { return(mode); } return(FindParentMode(element as FrameworkElement)); }
private ElementStateMode FindParentMode(FrameworkElement element) { if (element == null) { throw new ArgumentException(string.Format("You must set the ElementState.Mode attached property", element)); } ElementStateMode mode = GetMode(element.Parent); if (mode != ElementStateMode.Default) { return(mode); } return(FindParentMode(element.Parent as FrameworkElement)); }
public static void SetMode(DependencyObject element, ElementStateMode value) { element.SetValue(ModeProperty, value); }
internal ElementState(DependencyObject element) { this._uid = GetUId(element); this._mode = FindMode(element); this._type = element.GetType(); }