예제 #1
0
        private ElementStateMode FindMode(DependencyObject element)
        {
            ElementStateMode mode = GetMode(element);

            if (mode != ElementStateMode.Default)
            {
                return(mode);
            }
            return(FindParentMode(element as FrameworkElement));
        }
예제 #2
0
        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));
        }
예제 #3
0
 public static void SetMode(DependencyObject element, ElementStateMode value)
 {
     element.SetValue(ModeProperty, value);
 }
예제 #4
0
 internal ElementState(DependencyObject element)
 {
     this._uid  = GetUId(element);
     this._mode = FindMode(element);
     this._type = element.GetType();
 }
		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();
		}