Exemple #1
0
        public bool CanAttach(XenWidget widget)
        {
            if (widget == null)
            {
                return(false);
            }
            if (IsLayout)
            {
                return(true);
            }
            if (HasContentProperty && widget.IsContentPropertyViewType)
            {
                return(true);
            }
            if (HasContentProperty && widget.ContentPropertyTypeName != null && ContentPropertyTypeName == widget.ContentPropertyTypeName)
            {
                return(true);
            }

            return(false);
        }
Exemple #2
0
        public static IEnumerable <XenWidget> GetNodeAndDescendants(this XenWidget widget)
        {
            var descendants = widget.Children.RecursiveSelect(c => c.Children).Where(c => c != null);

            return(new[] { widget }.Concat(descendants));
        }