public void CanAddUseCases() { IApplicationModel applicationModel = CreateApplicationModel(); IActiveAwareUseCaseController mockActiveAwareUseCaseController = new MockUseCase(); applicationModel.AddMainUseCase(mockActiveAwareUseCaseController); Assert.IsTrue(applicationModel.MainUseCases.Contains(mockActiveAwareUseCaseController)); }
public void Initialize() { // Add the calendar Main usecase, which will add a button to the buttonbar. Clicking on the button will activate the usecase applicationModel.AddMainUseCase(mainCalenderUseCase); // Register a visualization for the CalendarMainViewMOdel. Whenever a region shows the CalenderMainViewModel, use the CalendarMainView to visualize it. // This is done by the VisualizingRegionManagerRegistrationBehavior which is added to all regions by default. modelVisualizationRegistry.Register <CalendarMainViewModel, CalendarMainView>(); // Whenever the GadgetRegion gets displayed, add a Gadget to it. This displays a different (More direct) way of visualizing ViewModels. // The ViewViewModelWrapper wraps both a View and a ViewModel. It is a control, so it can be placed in the visual tree (and thus easily // be added to a region) regionManager.RegisterViewWithRegion("GatgetRegion", typeof(ViewViewModelWrapper <CalendarSidebarGadget, CalendarSideBarGadgetViewModel>)); }
public void Initialize() { // Register visualizations for these view models. This means: whenever a viewmodel is displayed, // use this type of view to visualize it. modelVisualizationRegistry.Register <EmailToolBarViewModel, EmailToolBar>(); modelVisualizationRegistry.Register <EmailMainViewModel, EmailMainView>(); modelVisualizationRegistry.Register <EmailDetailViewModel, EmailDetailView>(); modelVisualizationRegistry.Register <NewEmailToolBarViewModel, NewEmailToolBar>(); modelVisualizationRegistry.Register <NewEmailViewModel, NewEmailView>(); // Add the main email usecase to the application model. This will make sure it displays a button for the usecase in the // buttonbar. Clicking the button will activate the use case. applicationModel.AddMainUseCase(mainEmailUseCase); // Make sure the EmailDetails are always displayed when the EmailDetailRegion is displayed (View Discovery technique) regionManager.RegisterViewWithRegion("EmailDetailRegion", typeof(EmailDetailViewModel)); }