public void ShouldReturnInheritedDependencyProperty() { UiDispatch.Invoke( () => { var obj = new TestControl { Content = "Test Value" }; object value; DependencyPropertiesAccessor.TryGetDependencyProperty(obj, "Content", out value); Assert.AreEqual(obj.GetValue(ContentControl.ContentProperty), value); }).Wait(); }
public void ShouldReturnDependencyPropertyDefinedAsField() { UiDispatch.Invoke( () => { var obj = new TestControl { Some = "Test Value" }; object value; DependencyPropertiesAccessor.TryGetDependencyProperty(obj, "Some", out value); Assert.AreEqual(obj.GetValue(TestControl.SomeProperty), value); }).Wait(); }
public void ShouldReturnDependencyPropertyDefinedAsProperty() { UiDispatch.Invoke( () => { var obj = new TextBox { IsReadOnly = true }; object value; DependencyPropertiesAccessor.TryGetDependencyProperty(obj, "IsReadOnly", out value); Assert.AreEqual(obj.GetValue(TextBox.IsReadOnlyProperty), value); }).Wait(); }
public bool TryGetDependencyProperty(string propertyName, out object value) { return(DependencyPropertiesAccessor.TryGetDependencyProperty(this.Element, propertyName, out value)); }