예제 #1
0
        public async Task When_MarkupExtension_Nested()
        {
            var page = new MarkupExtension_ParserContext();

            var sut      = (page.NestedMarkupExtension as TextBlock);
            var context  = (IXamlServiceProvider)sut.Tag;
            var pvt      = (IProvideValueTarget)context.GetService(typeof(IProvideValueTarget));
            var property = (ProvideValueTargetProperty)pvt.TargetProperty;

            Assert.IsInstanceOfType(pvt.TargetObject, typeof(Binding));
            Assert.AreEqual(property.Name, nameof(Binding.Source));
        }
예제 #2
0
        public async Task When_MarkupExtension_Default()
        {
            var page = new MarkupExtension_ParserContext();

            var sut      = (page.SimpleMarkupExtension as TextBlock);
            var context  = (IXamlServiceProvider)sut.Tag;
            var pvt      = (IProvideValueTarget)context.GetService(typeof(IProvideValueTarget));
            var property = (ProvideValueTargetProperty)pvt.TargetProperty;

            Assert.AreEqual(pvt.TargetObject, sut);
            Assert.AreEqual(property.Name, nameof(TextBlock.Tag));
        }