Inheritance: System.Windows.Controls.Control
コード例 #1
0
ファイル: GridAdorner.cs プロジェクト: fanyjie/SharpDevelop
		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;
			
		}
コード例 #2
0
        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;
        }