Exemple #1
0
        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();
        }
Exemple #2
0
        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();
        }
Exemple #3
0
        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));
 }