public void initializeCustomSettings(CadViewPort newViewPort) { this.Height = 700; this.Width = 900; this.Left = 10; this.Top = 10; this.Caption = "NVCad 视图窗口"; this.IsModal = false; var contentGrid = new Grid(); contentGrid.ColumnDefinitions.Add(new ColumnDefinition()); contentGrid.ColumnDefinitions[0].Width = new GridLength(20); contentGrid.ColumnDefinitions.Add(new ColumnDefinition()); contentGrid.ColumnDefinitions[1].Width = new GridLength(1, GridUnitType.Star); contentGrid.ColumnDefinitions.Add(new ColumnDefinition()); contentGrid.ColumnDefinitions[2].Width = new GridLength(20); contentGrid.RowDefinitions.Add(new RowDefinition()); contentGrid.RowDefinitions[0].Height = new GridLength(20); contentGrid.RowDefinitions.Add(new RowDefinition()); contentGrid.RowDefinitions[1].Height = new GridLength(1, GridUnitType.Star); contentGrid.RowDefinitions.Add(new RowDefinition()); contentGrid.RowDefinitions[2].Height = new GridLength(20); // Code Documentation Tag 20140603_05 primaryCanvas = new NVcad2dViewCanvas(newViewPort); primaryCanvas.Background = Brushes.Bisque; //primaryCanvas.establishTransforms(); contentGrid.Children.Add(primaryCanvas); Grid.SetRow(primaryCanvas, 1); Grid.SetColumn(primaryCanvas, 1); this.Content = contentGrid; }