Example #1
0
        public MainViewModel()
        {
            // Initialisation du Calendrier
            CalendarService.InitializeCalendarService();

            /*A Supprimer, le calendrier sera créé ailleurs*/
            CalendarService.AddEvent(new CommonCalendarEvent()
            {
                EventName = "TestEvent"
            }, 0);
            CalendarService.AddEvent(new CommonCalendarEvent()
            {
                EventName = "TestEvent2"
            }, 0);
            CalendarService.AddEvent(new CommonCalendarEvent()
            {
                EventName = "TestEvent3"
            }, 1);
            CalendarService.AddEvent(new CommonCalendarEvent()
            {
                EventName = "TestEvent"
            }, 2);
            CalendarService.AddEvent(new CommonCalendarEvent()
            {
                EventName = "TestEvent5"
            }, 5);
            CalendarService.AddEvent(new CommonCalendarEvent()
            {
                EventName = "TestEvent2"
            }, 3);
            CalendarService.AddEvent(new CommonCalendarEvent()
            {
                EventName = "TestEvent3"
            }, 4);
            CalendarService.AddEvent(new CommonCalendarEvent()
            {
                EventName = "TestEvent"
            }, 5);
            CalendarService.AddEvent(new CommonCalendarEvent()
            {
                EventName = "TestEvent2"
            }, 6);
            CalendarService.AddEvent(new CommonCalendarEvent()
            {
                EventName = "TestEvent3"
            }, 7);

            // Initialisation des événements de changement de vue
            CommonEventAggregator.GetCommonEventAggregator().GetEvent <GoToMainMenuEvent>().Subscribe(GoToMainMenuCallBack);
            CommonEventAggregator.GetCommonEventAggregator().GetEvent <GoToMatchEngineEvent>().Subscribe(GoToMacthEngineCallBack);
            CommonEventAggregator.GetCommonEventAggregator().GetEvent <GoToCalendarEvent>().Subscribe(GoToCalendarEventCallBack);
            CommonEventAggregator.GetCommonEventAggregator().GetEvent <GoToConfigurationGameEvent>().Subscribe(GoToConfigurationGameCallBack);
            CommonEventAggregator.GetCommonEventAggregator().GetEvent <GoToClubEvent>().Subscribe(GoToClubEventCallBack);
            CommonEventAggregator.GetCommonEventAggregator().GetEvent <GoToTeamEvent>().Subscribe(GoToTeamEventCallBack);
            CommonEventAggregator.GetCommonEventAggregator().GetEvent <GoToTacticEvent>().Subscribe(GoToTacticEventCallBack);
            CommonEventAggregator.GetCommonEventAggregator().GetEvent <GoToCreationGameEvent>().Subscribe(GoToCreationGameEventCallBack);

            // Implémentation des views et des viewmodels
            IModuleFactory <IMainMenuModuleViewModel> mainMenuModuleFactory = new MainMenuModuleFactory();

            MainContent = mainMenuModuleFactory.CreateView(null);
            IModuleFactory <ITopBannerModuleViewModel> topBannerModuleFactory = new TopBannerModuleFactory();

            TopBannerContent = topBannerModuleFactory.CreateView(null);

            // Masquage de la bannière supérieure au démarrage
            hideTopBanner();
            visibleBottomBanner();
        }
 private void CreateGameClick(object sender, RoutedEventArgs e)
 {
     CommonEventAggregator.GetCommonEventAggregator().GetEvent <GoToCreationGameEvent>().Publish(string.Empty);
 }
Example #3
0
 private void TacticClick(object sender, RoutedEventArgs e)
 {
     CommonEventAggregator.GetCommonEventAggregator().GetEvent <GoToTacticEvent>().Publish(DaoService.GetTeam(1));
     IsOpen = false;
 }
Example #4
0
 private void MainMenuClick(object sender, RoutedEventArgs e)
 {
     CommonEventAggregator.GetCommonEventAggregator().GetEvent <GoToMainMenuEvent>().Publish(string.Empty);
     IsOpen = false;
 }
Example #5
0
 private void ClubClick(object sender, RoutedEventArgs e)
 {
     CommonEventAggregator.GetCommonEventAggregator().GetEvent <GoToClubEvent>().Publish(DaoService.GetClub(1));
     IsOpen = false;
 }