public MainCalendarEvents(IViewManager viewManager, ICalendarEventService calendarEventService) { this.InitializeComponent(); MainCalendarEventsViewModel vm = (MainCalendarEventsViewModel)this.DataContext; // this creates an instance of the ViewModel if (vm.CloseAction == null) { vm.CloseAction = new Action(() => this.Close()); } vm.ViewManager = viewManager; vm.CalendarEventService = calendarEventService; }
public CalendarEventForm(IViewManager viewManager, ICalendarEventService calendarEventService, IUserService userService, IProjectService projectService)//You missed IUserService, which is used in your VM { InitializeComponent(); CalendarEventFormViewModel vm = (CalendarEventFormViewModel)this.DataContext; // this creates an instance of the ViewModel if (vm.CloseAction == null) { vm.CloseAction = new Action(() => this.Close()); } vm.ViewManager = viewManager; vm.CalendarEventService = calendarEventService; vm.UserService = userService; vm.ProjectService = projectService; }
public EventsListViewModel(IGoogleCalendar googleCalendar, ICalendarEventService eventService, ITimeIntervals timeInterval, IRepository commonRepository, IMessanger commonMessanger) { try { log.Debug("Loading EventsList view model..."); calendar = googleCalendar; service = eventService; period = timeInterval; repository = commonRepository; sortFilterPreferences = repository.GetSortFilterPreferences(); userCalendarPreferences = repository.GetUserCalendarsPreferences(); messanger = commonMessanger; UpdateUserCalendarPreferences(); Events = service.GetEventsMultipleCalendars(calendar, period.Today(), userCalendarPreferences); Events = service.FormatEventsDatesStringRepresentation(Events, repository.GetDateTimePreferences()); GetTodayEventsCommand = new RelayCommand(GetTodayEvents); GetTomorrowEventsCommand = new RelayCommand(GetTomorrowEvents); GetThisWeekEventsCommand = new RelayCommand(GetThisWeekEvents); GetNextWeekEventsCommand = new RelayCommand(GetNextWeekEvents); GetThisMonthEventsCommand = new RelayCommand(GetThisMonthEvents); GetNextMonthEventsCommand = new RelayCommand(GetNextMonthEvents); GetPeriodEventsCommand = new RelayCommand(GetPeriodEvents); RefreshCommand = new RelayCommand(RefreshEventsList); DeleteEventCommand = new RelayCommand(DeleteEvent); UpdateEventCommand = new RelayCommand(FullUpdateEvent); ConfirmEventCommand = new RelayCommand(ConfirmEvent); MakeTentativeEventCommand = new RelayCommand(MakeTentativeEvent); ShowChooseDateEventsControlsCommand = new RelayCommand(ShowChooseDateEventsControls); HideChooseDateEventsControlsCommand = new RelayCommand(HideChooseDateEventsControls); GetChooseDateEventsCommand = new RelayCommand(GetChooseDateEvents); SetSortingAndFilteringPreferencesCommand = new RelayCommand(SetSortingAndFilteringPreferences); SetCalendarCommand = new RelayCommand(SetCalendar); LogOutCommand = new RelayCommand(LogOut); log.Debug("EventsList view model was succssfully loaded"); } catch (Exception ex) { log.Error("Failed to load EventsList view model:", ex); } }
public OthersCalendarViewModel(IGoogleCalendar googleCalendar, ICalendarEventService eventService, ITimeIntervals timeInterval, IRepository commonRepository, IMessanger commonMessanger) { try { log.Debug("Loading EventsList view model..."); calendar = googleCalendar; service = eventService; period = timeInterval; repository = commonRepository; sortFilterPreferences = repository.GetSortFilterPreferences(); messanger = commonMessanger; OthersEvents = service.GetOthersEvents(calendar, period.Today(), _OtherCalendarsList); OthersEvents = service.FormatEventsDatesStringRepresentation(OthersEvents, repository.GetDateTimePreferences()); GetOtherCalendarsCommand = new RelayCommand(GetOtherCalendars); GetTodayEventsCommand = new RelayCommand(GetTodayEvents); GetTomorrowEventsCommand = new RelayCommand(GetTomorrowEvents); GetThisWeekEventsCommand = new RelayCommand(GetThisWeekEvents); GetNextWeekEventsCommand = new RelayCommand(GetNextWeekEvents); GetThisMonthEventsCommand = new RelayCommand(GetThisMonthEvents); GetNextMonthEventsCommand = new RelayCommand(GetNextMonthEvents); GetPeriodEventsCommand = new RelayCommand(GetPeriodEvents); RefreshCommand = new RelayCommand(RefreshEventsList); DeleteEventCommand = new RelayCommand(DeleteEvent); UpdateEventCommand = new RelayCommand(FullUpdateEvent); ConfirmEventCommand = new RelayCommand(ConfirmEvent); MakeTentativeEventCommand = new RelayCommand(MakeTentativeEvent); ShowChooseDateEventsControlsCommand = new RelayCommand(ShowChooseDateEventsControls); HideChooseDateEventsControlsCommand = new RelayCommand(HideChooseDateEventsControls); GetChooseDateEventsCommand = new RelayCommand(GetChooseDateEvents); SetSortingAndFilteringPreferencesCommand = new RelayCommand(SetSortingAndFilteringPreferences); LogOutCommand = new RelayCommand(LogOut); log.Debug("EventsList view model was succssfully loaded"); } catch(Exception ex) { log.Error("Failed to load EventsList view model:", ex); } }
public CalendarEventApiController(ICalendarEventService calendarEventService) { this._calendarEventService = calendarEventService; }
public CalendarEventApiController(ICalendarEventService service) : base(service) { }
public CalendarEventController(ICalendarEventService calendarEventService) { _calendarEventService = calendarEventService; }
// TODO: Get By Date Range // TODO: SoftDelete public CalendarEventsController(ICalendarEventService service, UserManager <ApplicationUser> manager) { this._service = service; this._manager = manager; }