public ExplorePageModel(Services.IDataService DataService) { _DataService = DataService; FeaturedAds = new ObservableCollection <Models.AdPost>(); FeaturedAds = _DataService.GetAdsFeatured(); }
public ListRecipesPageViewModel(INavigationService navigationService, Services.IDataService dataService, Prism.Services.IPageDialogService pageDialogService) { _pageDialogService = pageDialogService; _navigationService = navigationService; _dataService = dataService; Title = "Recipes in meal"; }
public ListMealsPageViewModel(INavigationService navigationService, Services.IDataService dataService, Prism.Services.IPageDialogService pageDialogService) { _pageDialogService = pageDialogService; _navigationService = navigationService; _dataService = dataService; Title = "Meals in week"; }
public HomeController(ILogger <HomeController> logger, Services.ICacheService cacheService, Services.IDataService dataService) { _logger = logger; this.cacheService = cacheService; this.dataService = dataService; }
public ListWeeksPageViewModel(INavigationService navigationService, Services.IDataService dataService, Prism.Services.IPageDialogService pageDialogService) { _pageDialogService = pageDialogService; _navigationService = navigationService; _dataService = dataService; Title = "Weeks for client"; }
public ListIngredientsPageViewModel(INavigationService navigationService, Services.IDataService dataService, Prism.Services.IPageDialogService pageDialogService) { _pageDialogService = pageDialogService; _navigationService = navigationService; _dataService = dataService; Title = "Ingredients in recipe"; }
public QuestionController(Services.IDataService <Entities.KnowledgeBaseItem> knowledgeData, Services.IQueryService <Entities.KnowledgeBaseItem> knowledgeQuery) { KnowledgeData = knowledgeData; KnowledgeQuery = knowledgeQuery; //TODO: Implement mapping as needed. throw new NotImplementedException(); }
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (values != null) { long id = (long)values[0]; long selectedId = (long)values[1]; Services.IDataService dataservice = (Services.IDataService)values[2]; string message = dataservice.GetLastMessage(id, selectedId); return(message); } return(""); }
public ShoppingPurchasedItemsTabViewModel(INavigationService navigationService, Services.IDataService dataService) { _navigationService = navigationService; _dataService = dataService; PropertyChanged += (s, e) => { if (e.PropertyName.Equals(nameof(SelectedItem)) && SelectedItem != null) { _dataService.MarkIngredientUnChecked(_clientId, _weekId, SelectedItem.Id); Items.Remove(SelectedItem); SelectedItem = null; } }; }
public ShoppingPageViewModel(INavigationService navigationService, Services.IDataService dataService) { _navigationService = navigationService; _dataService = dataService; Title = "Shopping list"; Tab1 = new TabLogic() { Title = "Pending items" }; Tab2 = new TabLogic() { Title = "Purchased items" }; }
public ListChefsPageViewModel(INavigationService navigationService, Services.IDataService dataService) { _navigationService = navigationService; _dataService = dataService; PropertyChanged += (s, e) => { if (e.PropertyName == nameof(SelectedItem)) { LoginCommand.RaiseCanExecuteChanged(); } }; Title = "Please login"; }
public BasicChatViewModel(IChatService chatService, IUserService userService, IMvxNavigationService navigationService, Services.IDataService dataService, IAppService appService) { _UserService = userService; _NavigationService = navigationService; _ChatService = chatService; _DataService = dataService; _AppService = appService; _ChatService.ConnectedChanged += (sender, e) => { Online = _ChatService.Connected; }; _ChatService.MessageReceived += (sender, e) => { // only interested in chat messages if (!(e.Message is ChatMessage)) { return; } // only interested in messages to/from this user var newMessage = (ChatMessage)e.Message; if (!newMessage.FromUser.Equals(_withUser) && !newMessage.ToUser.Equals(_withUser)) { return; } // now we're in business var existing = Messages.FirstOrDefault(mm => mm.MessageId.Equals(e.Message.MessageId)); if (existing == null) { existing = newMessage; } else { existing.FromUser = newMessage.FromUser; existing.MessageId = newMessage.MessageId; existing.ShowStatus = newMessage.ShowStatus; existing.RawPayload = newMessage.RawPayload; existing.Type = newMessage.Type; existing.ToUser = newMessage.ToUser; } existing.Sent = existing.FromUser.Equals(_UserService.User.ChatUserId); existing.Status = (existing.FromUser.Equals(_UserService.User.ChatUserId)) ? MessageStatus.Sent : MessageStatus.Delivered; Messages.Add(existing); }; }
public CustomerCodeViewModel(IGatewayService gatewayService, IReachability reachability, IDataService dataService, IRepositories repositories, ICustomUserInteraction userInteraction, INavigationService navigationService, ICloseApplication closeApplication) { _gatewayService = gatewayService; _dataService = dataService; _reachability = reachability; _userInteraction = userInteraction; _navigationService = navigationService; _applicationProfileRepository = repositories.ApplicationRepository; _customerRepository = repositories.CustomerRepository; _deviceRepository = repositories.DeviceRepository; _driverRepository = repositories.DriverRepository; _safetyProfileRepository = repositories.SafetyProfileRepository; _trailerRepository = repositories.TrailerRepository; _vehicleRepository = repositories.VehicleRepository; _verbProfileRepository = repositories.VerbProfileRepository; _configRepository = repositories.ConfigRepository; _closeApplication = closeApplication; }
public HomeController(ILogger <HomeController> logger, Services.IDataService <KnowledgeBaseItem> dataService, Services.IQueryService <KnowledgeBaseItem> queryService) { _logger = logger; KnowledgeBaseData = dataService; KnowledgeBaseQuery = queryService; //TODO: Implement mapping from QuestionAndAnswerModel to Entities.KnowledgeBaseItem. //LastUpdateOn field is set with DateTime.Now and Tags field with lowercase. //Also create a map from TagItem to TagModel. //Use "mapper" attribute which is already defined. More information: https://docs.automapper.org/en/latest/Getting-started.html. var configurationManager = new AutoMapper.MapperConfiguration( cfg => { cfg.CreateMap <QuestionAndAnswerModel, KnowledgeBaseItem>() .ForMember(x => x.Query, opt => opt.MapFrom(z => z.Question)) .ForMember(x => x.LastUpdateOn, opt => opt.MapFrom(z => DateTime.Now)); cfg.CreateMap <TagItem, TagModel>(); }); mapper = configurationManager.CreateMapper(); }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel(Services.IDataService dataService,Services.IDialogService dialogService) { _jobs = new System.Collections.ObjectModel.ObservableCollection<Model.Job>(); _favorites = new System.Collections.ObjectModel.ObservableCollection<string>(); _recents = new System.Collections.ObjectModel.ObservableCollection<string>(); _systemFolders = new System.Collections.ObjectModel.ObservableCollection<string>(); GalaSoft.MvvmLight.Messaging.Messenger.Default.Register<Messaging.FilesDropped>(this, files_Dropped); GalaSoft.MvvmLight.Messaging.Messenger.Default.Register<Messaging.FilesDroppedOnJob>(this, files_DroppedOnJob); GalaSoft.MvvmLight.Messaging.Messenger.Default.Register<Messaging.FilesDroppedOnFolder>(this, files_DroppedOnFolder); _dataService = dataService; _dialogService = dialogService; _dataService.GetData( (item, error) => { if (item == null || error != null) { // Report error here return; } if (item.Jobs != null) item.Jobs.ToList().ForEach(j => _jobs.Add(j)); if (item.Favorites != null) item.Favorites.ToList().ForEach(f => _favorites.Add(f)); if (item.Recents != null) item.Recents.ToList().ForEach(r => _recents.Add(r)); if (item.SystemFolders != null) item.SystemFolders.ToList().ForEach(sf => _systemFolders.Add(sf)); if (_jobs.Count > 0) _selectedJob = _jobs[0]; }); //select the "favorites" _selectedTabIndex = 1; this.PropertyChanged += MainViewModel_PropertyChanged; }