private void CreateModels() { _models = new ModelRegistry(); _models.Bind <Service.ICardTemplateService, CardTemplateService>(new CardTemplateService()); _models.Bind <IBoardModel, BoardModel>(new BoardModel(8, 8)); _models.Bind <IArbiterModel, ArbiterModel>(new ArbiterModel()); _models.Bind <IEndTurnButtonModel, EndTurnButtonModel>(); _models.Bind <ICardModel, CardModel>(); _models.Bind <IDeckModel, DeckModel>(); _models.Bind <IHandModel, HandModel>(); _models.Bind <IPieceModel, PieceModel>(); _models.Bind <IPlayerModel, PlayerModel>(); _models.Resolve(); _boardModel = _models.New <IBoardModel>(); _arbiterModel = _models.New <IArbiterModel>(); _whitePlayerModel = _models.New <IPlayerModel>(EColor.White); _blackPlayerModel = _models.New <IPlayerModel>(EColor.Black); // make all models required. this resolves any cycles of dependancy for // singletons, as well as creates models used internally by other models. foreach (var model in _models.Instances.ToList()) { model.PrepareModels(); } }