Ejemplo n.º 1
0
        private static GraphAreaBase GetAreaFromObject(object obj)
        {
            GraphAreaBase area = null;

            if (obj is VertexControl)
            {
                area = ((VertexControl)obj).RootArea;
            }
            else if (obj is EdgeControl)
            {
                area = ((EdgeControl)obj).RootArea;
            }
            else if (obj is DependencyObject)
            {
                area = VisualTreeHelperEx.FindAncestorByType((DependencyObject)obj, typeof(GraphAreaBase), false) as GraphAreaBase;
            }

            return(area);
        }
Ejemplo n.º 2
0
 public static Visual FindDescendantByType(Visual element, Type type)
 {
     return(VisualTreeHelperEx.FindDescendantByType(element, type, true));
 }
Ejemplo n.º 3
0
        public static T FindDescendantByType <T>(Visual element) where T : Visual
        {
            Visual temp = VisualTreeHelperEx.FindDescendantByType(element, typeof(T));

            return(( T )temp);
        }