Ejemplo n.º 1
0
        public void Detects_With_Both_Auto()
        {
            GridSplitter splitter;

            var grid = new Grid
            {
                ColumnDefinitions = new ColumnDefinitions("Auto,Auto,Auto"),
                RowDefinitions    = new RowDefinitions("Auto,Auto"),
                Children          =
                {
                    new Border {
                        [Grid.ColumnProperty] = 0
                    },
                    (splitter = new GridSplitter{
                        [Grid.ColumnProperty] = 1
                    }),
                    new Border {
                        [Grid.ColumnProperty] = 2
                    },
                }
            };

            var root = new TestRoot {
                Child = grid
            };

            root.Measure(new Size(100, 300));
            root.Arrange(new Rect(0, 0, 100, 300));
            Assert.Equal(GridResizeDirection.Columns, splitter.GetEffectiveResizeDirection());
        }
Ejemplo n.º 2
0
        public void Detects_Horizontal_Orientation()
        {
            GridSplitter splitter;

            var grid = new Grid
            {
                RowDefinitions    = new RowDefinitions("*,Auto,*"),
                ColumnDefinitions = new ColumnDefinitions("*,*"),
                Children          =
                {
                    new Border {
                        [Grid.RowProperty] = 0
                    },
                    (splitter = new GridSplitter{
                        [Grid.RowProperty] = 1
                    }),
                    new Border {
                        [Grid.RowProperty] = 2
                    }
                }
            };

            var root = new TestRoot {
                Child = grid
            };

            root.Measure(new Size(100, 300));
            root.Arrange(new Rect(0, 0, 100, 300));
            Assert.Equal(GridResizeDirection.Rows, splitter.GetEffectiveResizeDirection());
        }