protected override void SetValue(object obj, object value) { IObjectInstance objectInsance = obj as IObjectInstance; ObjectProperty property = objectInsance.LookupProperty(this); property.OnUserInput(value); }
protected override object GetValue(object obj) { IObjectInstance objectInsance = obj as IObjectInstance; ObjectProperty property = objectInsance.LookupProperty(this); return(property.Value); }
private ObjectProperty GetObjectProperty(object component) { // Find the object property. IObjectInstance objectInstance = ((IObjectInstance)component); ObjectProperty objectProperty = objectInstance.LookupProperty(this); return(objectProperty); }
// Called when the user edits the property. Sets the property in the wrapped object. private void OnPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { // Get the wrapped object. IObjectInstance objectInstance = (IObjectInstance)obj; object wrappedObject = objectInstance.WrappedObject; ObjectProperty objectProperty = objectInstance.LookupProperty(this); if (objectProperty != null) { // Set the property in the wrapped object. object value = obj.GetValue(_dependencyProperty); objectProperty.OnUserInput(value); } }
public object GetValue(object instance) { IObjectInstance obj = instance as IObjectInstance; if (obj == null) { return(null); } ObjectProperty property = obj.LookupProperty(this); if (property == null) { return(null); } return(property.GetValue()); }
public void SetValue(object instance, object value) { IObjectInstance obj = instance as IObjectInstance; if (obj == null) { return; } ObjectProperty property = obj.LookupProperty(this); if (property == null) { return; } property.SetValue(value); }