예제 #1
0
        public void All_Descendant_Grids_Are_Unregistered_When_Resetting_Scope()
        {
            var grids = new[] { new Grid(), new Grid(), new Grid() };
            var scope = new Panel();

            scope.Children.AddRange(grids);

            var root = new TestRoot();

            root.SetValue(Grid.IsSharedSizeScopeProperty, true);
            root.Child = scope;

            Assert.All(grids, g => Assert.True(g.HasSharedSizeScope()));
            root.SetValue(Grid.IsSharedSizeScopeProperty, false);
            Assert.All(grids, g => Assert.False(g.HasSharedSizeScope()));
            Assert.Equal(null, root.GetValue(Grid.s_sharedSizeScopeHostProperty));
        }
예제 #2
0
        public void All_Descendant_Grids_Are_Registered_When_Setting_Scope()
        {
            var grids = new[] { new Grid(), new Grid(), new Grid() };
            var scope = new Panel();

            scope.Children.AddRange(grids);

            var root = new TestRoot();

            root.Child = scope;
            root.SetValue(Grid.IsSharedSizeScopeProperty, true);

            Assert.All(grids, g => Assert.True(g.HasSharedSizeScope()));
        }