Пример #1
0
        public static DockPanel AddGroupDockPanel(this Panel parent, [NotNull] GroupHeader groupHeader, int depth = 0)
        {
            var dockPanel = CreateGroupPanel(groupHeader, depth);

            parent.Children.Add(dockPanel);
            return(dockPanel);
        }
Пример #2
0
        public static DockPanel CreateGroupPanel([NotNull] GroupHeader groupHeader, int depth = 0)
        {
            var dockPanel = new DockPanel();

            if (depth > 0)
            {
                var groupIntendRectangle = new Rectangle
                {
                    Width  = 2,
                    Margin = new Thickness {
                        Left = ViewConstants.Intend
                    },
                    Fill = GetResource("LightSeparatorColorBrush") as Brush,
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment   = VerticalAlignment.Stretch
                };
                dockPanel.Children.Add(groupIntendRectangle);
                DockPanel.SetDock(groupIntendRectangle, Dock.Left);
            }
            dockPanel.Children.Add(groupHeader);
            DockPanel.SetDock(groupHeader, Dock.Top);
            return(dockPanel);
        }