bool displayUnitSelector; // Indicates whether Grid UnitSeletor should be displayed. public GridRailAdorner(DesignItem gridItem, AdornerPanel adornerPanel, Orientation orientation) { Debug.Assert(gridItem != null); Debug.Assert(adornerPanel != null); this.gridItem = gridItem; this.grid = (Grid)gridItem.Component; this.adornerPanel = adornerPanel; this.orientation = orientation; this.displayUnitSelector=false; this.unitSelector = new GridUnitSelector(this); adornerPanel.Children.Add(unitSelector); if (orientation == Orientation.Horizontal) { this.Height = RailSize; previewAdorner = new GridColumnSplitterAdorner(this, gridItem, null, null); } else { // vertical this.Width = RailSize; previewAdorner = new GridRowSplitterAdorner(this, gridItem, null, null); } unitSelector.Orientation = orientation; previewAdorner.IsPreview = true; previewAdorner.IsHitTestVisible = false; unitSelector.Visibility = Visibility.Hidden; }
bool displayUnitSelector; // Indicates whether Grid UnitSeletor should be displayed. public GridRailAdorner(DesignItem gridItem, AdornerPanel adornerPanel, Orientation orientation) { Debug.Assert(gridItem != null); Debug.Assert(adornerPanel != null); this.gridItem = gridItem; this.grid = (Grid)gridItem.Component; this.adornerPanel = adornerPanel; this.orientation = orientation; this.displayUnitSelector = false; this.unitSelector = new GridUnitSelector(this); adornerPanel.Children.Add(unitSelector); if (orientation == Orientation.Horizontal) { this.Height = RailSize; previewAdorner = new GridColumnSplitterAdorner(this, gridItem, null, null); } else // vertical { this.Width = RailSize; previewAdorner = new GridRowSplitterAdorner(this, gridItem, null, null); } unitSelector.Orientation = orientation; previewAdorner.IsPreview = true; previewAdorner.IsHitTestVisible = false; unitSelector.Visibility = Visibility.Hidden; }