Widget CreateContentPane(IUIStyle style) { var g = new Grid(style); g.ColumnConstraints.Add(LengthConstraint.Percentage(100)); g.RowConstraints.Add(LengthConstraint.Auto); g.RowConstraints.Add(LengthConstraint.Relative(1)); g.Add(CreateStyleSelector(style), new Point(0, 0)); g.Add(WidgetDemo.CreateRootPanel(style), new Point(0, 1)); return(g); }
protected override void Initialize() { base.Initialize(); IsMouseVisible = true; uiManager = UIManagerComponent.CreateAndInit(this, new InputManager(this), "Content").Manager; var styleSystem = uiManager.UIStyle; var styles = styleSystem.LoadStyles("Content/UI/Metro/style.xml", "UI/Metro", GraphicsDevice); styleSystem.StyleResolver.StyleRules.AddRange(styles); uiManager.Root.Content = WidgetDemo.CreateRootPanel(styleSystem); this.CenterOnScreen(); }