public IHistoryEventService GetHistoryEventService() { if (historyEventService == null) { historyEventService = new HistoryEventServiceClass(); } return(historyEventService); }
public NewListPageViewModel(INavigationService navigationService, IHistoryEventService historyEventService, ICategoryService categoryService) : base(navigationService) { Title = "Sự kiện lịch sử"; this.historyEventService = historyEventService; this.categoryService = categoryService; Page = 0; PageSize = 10; this.Events = historyEventService.GetListByEnventPaging(this.Page, this.PageSize); this.Categories = new ObservableRangeCollection <CategoryEvent>(categoryService.GetCategoryEvents()); CategoryTappedCommand = new DelegateCommand <object>(async(Oid) => await CategoryTappedCommandExecute(Oid)); }
public MapPageViewModel(IFamousePersonService personService, IHistoryEventService historyEventService, IImageService imgService) { this.personService = personService; this.historyEventService = historyEventService; this.imgService = imgService; Task.Run(async() => { try { var famousePersonsDto = await this.personService.FindAllAsync(); FamousPersons = DtoConvertToModel.FamousePersonsConvert(famousePersonsDto); var eventsDto = await this.historyEventService.FindAllAsync(); HistoryEvents = DtoConvertToModel.HistoryEventsConvert(eventsDto); } catch (ApiErrorException e) { MessageBox.Show(e.Message); } await personSymbol.SetSourceAsync(new Uri(MapMarkerConfig.PERSON_MARKER)); await eventSymbol.SetSourceAsync(new Uri(MapMarkerConfig.EVENT_MARKER)); if (FamousPersons != null) { foreach (var value in FamousPersons) { personsLayers.Dispatcher.Invoke(() => { //personsLayers.Graphics.Add(new Graphic(new MapPoint(-7000000, 3900000), personSymbol)); AddPersonGraphic(value); }); } } if (HistoryEvents != null) { foreach (var value in HistoryEvents) { // eventsLayer.Graphics.Add(new Graphic(new MapPoint(-7000000, 4000000), (Symbol)GetGloabelResorce("RedMarkerSymbolCircle"))); AddEventGraphic(value); } } }); }
public EventsInfoViewModel(IHistoryEventService historyEventService, IImageService imgService) { this.historyEventService = historyEventService; this.imgService = imgService; Task.Run(async() => { //try //{ // var famousePersonsDto = await this.personService.FindAllAsync(); // FamousPersons = DtoConvertToModel.FamousePersonsConvert(famousePersonsDto); //} //catch (ApiErrorException e) //{ // MessageBox.Show(e.Message); //} //延迟3S执行 await Task.Delay(1000); var mapPageViewModelInstance = ViewModelLocator.MapPageViewModelInstance; if (mapPageViewModelInstance.HistoryEvents != null) { HistoryEvents = mapPageViewModelInstance.HistoryEvents; } }); }
public HistoryEventController(IHistoryEventService historyEventService, IPictureService pictureService) { this.HistoryEventService = historyEventService; this.PictureService = pictureService; }
public EventAddViewModel(IHistoryEventService historyEventService, IImageService imageService) { this.historyEventService = historyEventService; this.imageService = imageService; Initial(); }
public EventAddDialogViewModel(IHistoryEventService historyEventService, IImageService imageService) { this.historyEventService = historyEventService; this.imageService = imageService; }