Пример #1
0
        public void TestLowerChild()
        {
            var view = new NaiveLayout();

            var child1 = new View();
            var child2 = new View();
            var child3 = new View();

            view.Children.Add(child1);
            view.Children.Add(child2);
            view.Children.Add(child3);

            bool reordered = false;

            view.ChildrenReordered += (sender, args) => reordered = true;

            view.LowerChild(child3);

            Assert.AreEqual(child3, ((IElementController)view).LogicalChildren [0]);
            Assert.True(reordered);

            view.LowerChild(child2);
            Assert.AreEqual(child2, ((IElementController)view).LogicalChildren [0]);
        }
Пример #2
0
        public void TestLowerUnownedChild()
        {
            var view = new NaiveLayout();

            var child1 = new View();
            var child2 = new View();
            var child3 = new View();

            view.Children.Add(child1);
            view.Children.Add(child3);

            bool reordered = false;

            view.ChildrenReordered += (sender, args) => reordered = true;

            view.LowerChild(child2);

            Assert.False(reordered);
        }