private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { InspectorPropertyData dataContext = (InspectorPropertyData)this.DataContext; this.inspectorFactory = new InspectorFactory( dataContext.EditorContext, dataContext.EditorContext != null ? dataContext.EditorContext.LocalizationContext : null); InspectorPropertyAttribute inspectorProperty = dataContext.InspectorProperty; this.itemType = inspectorProperty.AttributeType ?? inspectorProperty.PropertyType.GetGenericArguments()[0]; this.itemInspectorProperty = inspectorProperty.Clone(); this.itemInspectorProperty.PropertyType = this.itemType; // Set items. this.ClearItemControls(); if (dataContext.Value != null) { // Backwards compatibility if the attribute was a single item first and // changed to a list now. IList items = dataContext.Value as IList; if (items != null) { foreach (var item in items) { this.AddItemControl(item); } } else { this.AddItemControl(dataContext.Value); } } }
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { InspectorPropertyData dataContext = (InspectorPropertyData)this.DataContext; InspectorDataAttribute inspectorDataAttribute = (InspectorDataAttribute)dataContext.InspectorProperty; this.value = (IAttributeTable)dataContext.Value; this.inspectorFactory = new InspectorFactory(dataContext.EditorContext, null); InspectorType typeInfo = InspectorType.GetInspectorType(inspectorDataAttribute.PropertyType); this.inspectorFactory.AddInspectorControls(typeInfo, this.Controls, this.GetPropertyValue, this.OnPropertyValueChanged, false); }
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { InspectorPropertyData dataContext = (InspectorPropertyData)this.DataContext; InspectorDataAttribute inspectorDataAttribute = (InspectorDataAttribute)dataContext.InspectorProperty; this.value = (IAttributeTable)dataContext.Value; this.inspectorFactory = new InspectorFactory(dataContext.EditorContext, null); InspectorType typeInfo = InspectorType.GetInspectorType(inspectorDataAttribute.PropertyType); this.inspectorFactory.AddInspectorControls(typeInfo, this.Controls, this.GetPropertyValue, this.OnPropertyValueChanged, false); }
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { InspectorPropertyData dataContext = (InspectorPropertyData)this.DataContext; this.inspectorFactory = new InspectorFactory( dataContext.EditorContext, dataContext.EditorContext != null ? dataContext.EditorContext.LocalizationContext : null); EntityConfiguration entityConfiguration = (EntityConfiguration)this.Value; if (entityConfiguration != null) { // Select correct blueprint view model. this.CbBlueprint.SelectedBlueprintId = entityConfiguration.BlueprintId; } this.UpdateAttributeTable(); }
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { InspectorPropertyData dataContext = (InspectorPropertyData)this.DataContext; this.inspectorFactory = new InspectorFactory( dataContext.EditorContext, dataContext.EditorContext != null ? dataContext.EditorContext.LocalizationContext : null); EntityConfiguration entityConfiguration = (EntityConfiguration)this.Value; if (entityConfiguration != null) { // Select correct blueprint view model. this.CbBlueprint.SelectedBlueprintId = entityConfiguration.BlueprintId; } this.UpdateAttributeTable(); }
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { InspectorPropertyData dataContext = (InspectorPropertyData)this.DataContext; this.inspectorFactory = new InspectorFactory( dataContext.EditorContext, dataContext.EditorContext != null ? dataContext.EditorContext.LocalizationContext : null); InspectorPropertyAttribute inspectorProperty = dataContext.InspectorProperty; this.itemType = inspectorProperty.AttributeType ?? inspectorProperty.PropertyType.GetGenericArguments()[0]; this.itemInspectorProperty = inspectorProperty.Clone(); this.itemInspectorProperty.PropertyType = this.itemType; // Set items. this.ClearItemControls(); if (dataContext.Value != null) { // Backwards compatibility if the attribute was a single item first and // changed to a list now. IList items = dataContext.Value as IList; if (items != null) { foreach (var item in items) { this.AddItemControl(item); } } else { this.AddItemControl(dataContext.Value); } } }