Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
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();
        }