/// <summary> /// Creates the property instance. /// </summary> /// <param name="owner">The owner.</param> /// <returns>ComplexProperty instance.</returns> internal override ComplexProperty CreatePropertyInstance(ServiceObject owner) { TComplexProperty complexProperty = this.propertyCreationDelegate(); IOwnedProperty ownedProperty = complexProperty as IOwnedProperty; if (ownedProperty != null) { ownedProperty.Owner = owner; } return(complexProperty); }
/// <summary> /// Initializes a ComplexProperty instance. When a property is inserted into the bag, it needs to be /// initialized in order for changes that occur on that property to be properly detected and dispatched. /// </summary> /// <param name="complexProperty">The ComplexProperty instance to initialize.</param> private void InitComplexProperty(ComplexProperty complexProperty) { if (complexProperty != null) { complexProperty.OnChange += this.PropertyChanged; IOwnedProperty ownedProperty = complexProperty as IOwnedProperty; if (ownedProperty != null) { ownedProperty.Owner = this.Owner; } } }