コード例 #1
0
        public virtual void EndPlacement(PlacementOperation operation)
        {
            InfoTextEnterArea.Stop(ref infoTextEnterArea);

            this.ExtendedItem.Services.Selection.SetSelectedComponents(null);
            this.ExtendedItem.Services.Selection.SetSelectedComponents(operation.PlacedItems.Select(x => x.Item).ToList());
        }
コード例 #2
0
        private bool internalCanEnterContainer(PlacementOperation operation)
        {
            InfoTextEnterArea.Stop(ref infoTextEnterArea);

            if (ExtendedItem.Component is Expander)
            {
                if (!((Expander)ExtendedItem.Component).IsExpanded)
                {
                    ((Expander)ExtendedItem.Component).IsExpanded = true;
                }
            }

            if (ExtendedItem.Component is UserControl && ExtendedItem.ComponentType != typeof(UserControl))
            {
                return(false);
            }

            if (ExtendedItem.Component is Decorator)
            {
                return(((Decorator)ExtendedItem.Component).Child == null);
            }

            if (ExtendedItem.ContentProperty.IsCollection)
            {
                return(CollectionSupport.CanCollectionAdd(ExtendedItem.ContentProperty.ReturnType,
                                                          operation.PlacedItems.Select(p => p.Item.Component)));
            }
            if (ExtendedItem.View is ContentControl)
            {
                if (!CanContentControlAdd((ContentControl)ExtendedItem.View))
                {
                    return(false);
                }
            }

            if (ExtendedItem.ContentProperty.ReturnType == typeof(string))
            {
                return(false);
            }

            if (!ExtendedItem.ContentProperty.IsSet)
            {
                return(true);
            }

            object value = ExtendedItem.ContentProperty.ValueOnInstance;

            // don't overwrite non-primitive values like bindings
            return(ExtendedItem.ContentProperty.Value == null && (value is string && string.IsNullOrEmpty(value as string)));
        }
コード例 #3
0
 public virtual void EndPlacement(PlacementOperation operation)
 {
     InfoTextEnterArea.Stop(ref infoTextEnterArea);
 }