23 |
23 |
24 Grid windowGrid = new Grid(); |
24 Grid windowGrid = new Grid(); |
25 ColumnDefinition column = new ColumnDefinition(); |
25 ColumnDefinition column = new ColumnDefinition(); |
26 column.Width = new GridLength(1, GridUnitType.Star); |
26 column.Width = new GridLength(1, GridUnitType.Star); |
27 windowGrid.ColumnDefinitions.Add(column); |
27 windowGrid.ColumnDefinitions.Add(column); |
28 |
28 this.AddChild(windowGrid); |
29 AddChild(windowGrid); |
|
30 int rowIndex = 0; |
29 int rowIndex = 0; |
31 |
30 |
32 // menu |
31 // menu |
33 Application app = Application.GetInstance(); |
32 Application app = Application.GetInstance(); |
34 if (!app.AppMenu.IsEmpty()) |
33 if (!app.AppMenu.IsEmpty() && false) |
35 { |
34 { |
36 System.Windows.Controls.Menu menu = app.AppMenu.CreateMenu(uiobj); |
35 System.Windows.Controls.Menu menu = app.AppMenu.CreateMenu(uiobj); |
37 |
36 |
38 RowDefinition menuRow = new RowDefinition(); |
37 RowDefinition menuRow = new RowDefinition(); |
39 menuRow.Height = GridLength.Auto; |
38 menuRow.Height = GridLength.Auto; |
49 |
48 |
50 // content |
49 // content |
51 RowDefinition contentRow = new RowDefinition(); |
50 RowDefinition contentRow = new RowDefinition(); |
52 contentRow.Height = new GridLength(1, GridUnitType.Star); |
51 contentRow.Height = new GridLength(1, GridUnitType.Star); |
53 windowGrid.RowDefinitions.Add(contentRow); |
52 windowGrid.RowDefinitions.Add(contentRow); |
54 Grid content = new Grid(); |
53 BoxContainer vbox = new BoxContainer(BoxOrientation.VERTICAL); |
55 Grid.SetColumn(content, 0); |
54 Grid.SetColumn(vbox, 0); |
56 Grid.SetRow(content, rowIndex); |
55 Grid.SetRow(vbox, rowIndex); |
57 windowGrid.Children.Add(content); |
56 windowGrid.Children.Add(vbox); |
58 rowIndex++; |
57 rowIndex++; |
59 |
58 |
60 Container = new BoxContainer(content, BoxOrientation.VERTICAL); |
59 Container = vbox; |
61 |
60 |
62 Closed += CloseEvent; |
61 Closed += CloseEvent; |
63 } |
62 } |
64 |
63 |
65 public static MainWindow CreateMainWindow(String title, IntPtr uiobj) |
64 public static MainWindow CreateMainWindow(String title, IntPtr uiobj) |