/// <summary> /// This is method is invoked with GameManagers container property is first invoked to setup the bare essential uFrame necessities. /// </summary> /// <param name="manager">The game manager instance.</param> /// <param name="container"></param> public static void Configure(GameManager manager, IGameContainer container) { // The view resolver is the class that will find a view-prefab from a view-model container.RegisterInstance <IViewResolver>(new ViewResolver()); // The game manager is the default command dispatcher container.RegisterInstance <ICommandDispatcher>(manager); }
/// <summary> /// This is method is invoked with GameManagers container property is first invoked to setup the bare essential uFrame necessities. /// </summary> /// <param name="manager">The game manager instance.</param> /// <param name="container"></param> public static void Configure(GameManager manager, IGameContainer container) { // The view resolver is the class that will find a view-prefab from a view-model container.RegisterInstance<IViewResolver>(new ViewResolver()); // The game manager is the default command dispatcher container.RegisterInstance<ICommandDispatcher>(manager); }
public static void RegisterController <TController>(this IGameContainer container, TController controller) where TController : Controller { container.RegisterInstance <Controller>(controller, controller.GetType().Name, false); container.RegisterInstance <TController>(controller, false); }
public static void RegisterViewModel <TViewModel>(this IGameContainer container, TViewModel viewModel, string identifier) where TViewModel : ViewModel { container.Register <TViewModel, TViewModel>(); container.RegisterInstance <ViewModel>(viewModel, identifier); container.RegisterInstance(typeof(TViewModel), viewModel, identifier); }