/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. _spriteBatch = new SpriteBatch(GraphicsDevice); _uiRoot = new BasicUI(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height); var fooBar = new FooBar("Pete", 30); var fooBarVM = new FooBarViewModel(fooBar); var fooControl = _uiRoot.GetTheFooBarUserControl; fooControl.DataContext = fooBarVM; _viewModel = new BasicUIViewModel(); _uiRoot.DataContext = _viewModel; var font = Content.Load<SpriteFont>("Kootenay_9_Regular"); EmptyKeys.UserInterface.FontManager.DefaultFont = EmptyKeys.UserInterface.Engine.Instance.Renderer.CreateFont(font); EmptyKeys.UserInterface.FontManager.Instance.LoadFonts(Content); }
public FooBarViewModel(FooBar fooBar) { _fooBar = fooBar; ServiceManager.Instance.AddService(this); }