// IPropertyViewManager Members // <summary> // Add a property into the correct category within the specified CategoryList. // </summary> // <param name="propertySet">Specified property (passed in as a set for multi-select scenarios)</param> // <param name="propertyName">Name of the current property (perf optimization)</param> // <param name="categoryList">CategoryList instance to populate</param> // <returns>Wrapped ModelPropertyEntry for the specified propertySet</returns> public ModelPropertyEntry AddProperty(IEnumerable<ModelProperty> propertySet, string propertyName, CategoryList categoryList) { string categoryName = System.Activities.Presentation.Internal.Properties.Resources.PropertyCategoryAllProperties; ModelCategoryEntry category = categoryList.FindCategory(categoryName) as ModelCategoryEntry; bool reuseEntries = ExtensibilityAccessor.IsEditorReusable(propertySet); if (reuseEntries && category != null) { ModelPropertyEntry foundProperty; if ((foundProperty = (ModelPropertyEntry)category[propertyName]) != null) { if (foundProperty.PropertyType != null && foundProperty.PropertyType.Equals(System.Activities.Presentation.Internal.PropertyEditing.Model.ModelUtilities.GetPropertyType(propertySet))) { // Found a match for the property, so reuse it bool oldIsBrowsable = foundProperty.IsBrowsable; foundProperty.SetUnderlyingModelProperty(propertySet); // If the IsBrowsable or IsAdvanced value of the property changed, // refresh the property within the category, because how and whether // this property should be rendered may have changed. // Note that refreshing a selected property also nullifies its stickiness // (ie. it resets CategoryList.PropertySelectionMode) if (oldIsBrowsable != foundProperty.IsBrowsable) { category.Refresh(foundProperty, category.BasicProperties, this.PropertyComparer); } return foundProperty; } } } if (category == null) { category = new ModelCategoryEntry(categoryName); categoryList.InsertAlphabetically(category); } ModelPropertyEntry property = new ModelPropertyEntry(propertySet, null); category.Add(property, category.BasicProperties, this.PropertyComparer); return property; }
// <summary> // Adds the specified property into the specified category. // </summary> // <param name="property">Property to add</param> // <param name="category">Category to populate</param> public void AddProperty(PropertyEntry property, ModelCategoryEntry category) { category.Add(property, category.BasicProperties, this.PropertyComparer); }
public CategoryContainerItemAutomationPeer( ModelCategoryEntry item, CiderCategoryContainer container, CategoryListAutomationPeer parentAutomationPeer) : base(item, parentAutomationPeer) { _coreLogic = new CategoryContainerAutomationPeer(container, this); _coreLogic.AddFocusEvents(); }
// <summary> // Creates a CategoryContainerAutomationPeer that can be returned for CategoryContainers // belonging to a CategoryList control // </summary> // <param name="category">CategoryEntry instance used by ItemsControl</param> // <param name="container">Container to automate</param> // <param name="parentAutomationPeer">Parent AutomationPeer</param> // <returns>Instance of CategoryContainerAutomationPeer that can be returned for CategoryContainers // belonging to a CategoryList control</returns> public static ItemAutomationPeer CreateItemAutomationPeer(ModelCategoryEntry category, CiderCategoryContainer container, CategoryListAutomationPeer parentAutomationPeer) { return new CategoryContainerItemAutomationPeer(category, container, parentAutomationPeer); }
// <summary> // Adds the specified property into the specified category. // </summary> // <param name="property">Property to add</param> // <param name="category">Category to populate</param> public void AddProperty(PropertyEntry property, ModelCategoryEntry category) { category.Add(property as ModelPropertyEntry, category.GetBucket(property), this.PropertyComparer); }