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()); }
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))); }
public virtual void EndPlacement(PlacementOperation operation) { InfoTextEnterArea.Stop(ref infoTextEnterArea); }