public PropertyMetadata GetMetadata(IDependencyObject d) { if (metadataByType.ContainsKey(d.GetType())) { return(metadataByType[d.GetType()]); } return(null); }
public PropertyMetadata GetMetadata(IDependencyObject dependencyObject) { if (dependencyObject != null) { return(GetMetadata(dependencyObject.GetType())); } return(null); }
public event DependencyPropertyChangedCallback PropertyChanged; // TODO: should be a weak event public DependencyComponent(IDependencyObject owner) { this.owner = owner; this.ownerType = owner.GetType(); this.valueSources = Dependency.ValueSources.GetValueSources(this); this.effectiveSources = new Dictionary <IDependencyProperty, IValueSource>(); this.localStore = GetValueSource <LocalValueStore>(); for (int i = 0; i < this.valueSources.Count; i++) { this.valueSources[i].ValueChanged += OnValueChanged; } }
/// <summary> /// Initializes a new instance of the <see cref="DependencyObjectContainer"/> class. /// </summary> /// <param name="representedObject">The <see cref="IDependencyObject"/> type whichs dependency propertys should be represented.</param> public DependencyObjectContainer(IDependencyObject representedObject) { RepresentedObject = representedObject ?? throw new ArgumentNullException(nameof(representedObject)); _DependencyType = DependencyType.GetDependencyType(RepresentedObject.GetType().GetTypeInfo(), true); }
/// <summary> /// Initializes a new instance of the <see cref="DependencyObjectContainer"/> class. /// </summary> internal DependencyObjectContainer() { RepresentedObject = (this as IDependencyObject) ?? throw new NotSupportedException("Object must inherit from IDependencyObject"); _DependencyType = DependencyType.GetDependencyType(RepresentedObject.GetType().GetTypeInfo(), true); }
public PropertyMetadata GetMetadata(IDependencyObject d) { if (metadataByType.ContainsKey (d.GetType())) return metadataByType[d.GetType()]; return null; }
public PropertyMetadata GetMetadata(IDependencyObject dependencyObject) { if (dependencyObject != null) return GetMetadata(dependencyObject.GetType()); return null; }