40 this.AddChild(windowGrid); |
40 this.AddChild(windowGrid); |
41 int rowIndex = 0; |
41 int rowIndex = 0; |
42 |
42 |
43 // menu |
43 // menu |
44 Application app = Application.GetInstance(); |
44 Application app = Application.GetInstance(); |
45 if (!app.AppMenu.IsEmpty()) |
45 if (!app.Menu.IsEmpty()) |
46 { |
46 { |
47 System.Windows.Controls.Menu menu = app.AppMenu.CreateMenu(uiobj); |
47 System.Windows.Controls.Menu menu = app.Menu.CreateMenu(uiobj); |
48 |
48 |
49 RowDefinition menuRow = new RowDefinition(); |
49 RowDefinition menuRow = new RowDefinition(); |
50 menuRow.Height = GridLength.Auto; |
50 menuRow.Height = GridLength.Auto; |
51 windowGrid.RowDefinitions.Add(menuRow); |
51 windowGrid.RowDefinitions.Add(menuRow); |
52 |
52 |
53 Grid.SetRow(menu, 0); |
53 Grid.SetRow(menu, rowIndex); |
54 Grid.SetColumn(menu, rowIndex); |
54 Grid.SetColumn(menu, 0); |
55 windowGrid.Children.Add(menu); |
55 windowGrid.Children.Add(menu); |
56 rowIndex++; |
56 rowIndex++; |
57 } |
57 } |
58 |
58 |
59 // TODO: toolbar |
59 // toolbar |
|
60 if(app.ToolBar.HasItems()) |
|
61 { |
|
62 System.Windows.Controls.ToolBarTray tray = app.ToolBar.CreateToolBarTray(uiobj); |
|
63 RowDefinition menuRow = new RowDefinition(); |
|
64 menuRow.Height = GridLength.Auto; |
|
65 windowGrid.RowDefinitions.Add(menuRow); |
|
66 |
|
67 Grid.SetRow(tray, rowIndex); |
|
68 Grid.SetColumn(tray, 0); |
|
69 windowGrid.Children.Add(tray); |
|
70 rowIndex++; |
|
71 } |
60 |
72 |
61 // content |
73 // content |
62 RowDefinition contentRow = new RowDefinition(); |
74 RowDefinition contentRow = new RowDefinition(); |
63 contentRow.Height = new GridLength(1, GridUnitType.Star); |
75 contentRow.Height = new GridLength(1, GridUnitType.Star); |
64 windowGrid.RowDefinitions.Add(contentRow); |
76 windowGrid.RowDefinitions.Add(contentRow); |