Esempio n. 1
0
		public static Area GetArea (UIElement uielement)
		{
			if (uielement == null)
				return null;

			if (uielement is Area)
				return uielement as Area;

			for (int i = 0; i < uielement.VisualChildrenCount; i++) {
				var child = GetArea (uielement.GetVisualChild (i) as UIElement);

				if (child != null)
					return child;
			}

			return null;
		}
Esempio n. 2
0
		private Area GetArea (Token token, UIElement uielement)
		{
			if (uielement == null)
				return null;

			if (uielement is FrameworkElement && (uielement as FrameworkElement).DataContext == token)
				return uielement as Area;

			
			for (int i = 0; i < uielement.VisualChildrenCount; i++) {
				var child = GetArea (token, uielement.GetVisualChild (i) as UIElement);

				if (child != null)
					return child;
			}

			return null;
		}