예제 #1
0
            public void RelativeSourceSelfBinding(bool useCompiledXaml)
            {
                var view  = new Gh3847(useCompiledXaml);
                var label = view.FindByName <Label>("SelfBindingLabel");

                Assert.AreEqual(label.Text, label.StyleId);
            }
예제 #2
0
            public void RelativeSourceTemplatedParentBinding(bool useCompiledXaml)
            {
                var view  = new Gh3847(useCompiledXaml);
                var cv    = view.FindByName <ContentView>("contentView");
                var label = cv.Children[0] as Label;

                Assert.AreEqual(label.Text, cv.StyleId);
            }
예제 #3
0
            public void RelativeSourceAncestorLevelBinding(bool useCompiledXaml)
            {
                var view        = new Gh3847(useCompiledXaml);
                var stack0      = view.FindByName <StackLayout>("Stack0");
                var stack1      = view.FindByName <StackLayout>("Stack1");
                var level1Label = view.FindByName <Label>("AncestorLevel1Label");
                var level2Label = view.FindByName <Label>("AncestorLevel2Label");
                var level3Label = view.FindByName <Label>("AncestorLevel3Label");
                var ancestorBindingContextLabel = view.FindByName <Label>("AncestorBindingContextLabel");

                Assert.AreEqual(level1Label.Text, stack1.StyleId);
                Assert.AreEqual(level2Label.Text, stack0.StyleId);
                Assert.AreEqual(ancestorBindingContextLabel.Text, "Foo");
                Assert.IsNull(level3Label.Text);
            }