Exemple #1
0
        Grid PairVertical(GridDataTemeplate _top, GridDataTemeplate _bottom)
        {
            Grid grid = new Grid()
            {
            };

            grid.RowDefinitions.Add(new RowDefinition()
            {
                Height = _top.Length, MinHeight = _top.MinHeight
            });
            grid.RowDefinitions.Add(new RowDefinition()
            {
                Height = _bottom.Length, MinHeight = _bottom.MinHeight
            });

            GridSplitter splitV = new GridSplitter()
            {
                VerticalAlignment = VerticalAlignment.Top, Opacity = 0.5f, CursorBehavior = GridSplitter.SplitterCursorBehavior.ChangeOnGripperHover
            };

            ((Grid)_bottom.Content).Margin = new Thickness(0, 16, 0, 0);
            ((Grid)_top.Content).Padding   = new Thickness(0, 16, 0, 0);
            grid.Padding = new Thickness(0, -16, 0, 0);

            grid.Children.Add(_top.Content);
            grid.Children.Add(_bottom.Content);
            Grid.SetRow((FrameworkElement)_bottom.Content, 1);
            Grid.SetRow(splitV, 1);
            grid.Children.Add(splitV);

            return(grid);
        }
Exemple #2
0
        Grid PairHorizontal(GridDataTemeplate _left, GridDataTemeplate _right)
        {
            Grid grid = new Grid()
            {
                ColumnSpacing = 16
            };

            grid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = _left.Length, MinWidth = _left.MinWidth
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = _right.Length, MinWidth = _right.MinWidth
            });

            GridSplitter splitH = new GridSplitter()
            {
                HorizontalAlignment = HorizontalAlignment.Right,
                Margin         = new Thickness(0, 0, -16, 0),
                Opacity        = 0.5f,
                CursorBehavior = GridSplitter.SplitterCursorBehavior.ChangeOnGripperHover,
                ResizeBehavior = GridSplitter.GridResizeBehavior.BasedOnAlignment
            };

            grid.Children.Add(_left.Content);
            grid.Children.Add(_right.Content);
            Grid.SetColumn((FrameworkElement)_right.Content, 1);
            grid.Children.Add(splitH);


            return(grid);
        }