Exemplo n.º 1
0
        public ExplorePageModel(Services.IDataService DataService)
        {
            _DataService = DataService;

            FeaturedAds = new ObservableCollection <Models.AdPost>();
            FeaturedAds = _DataService.GetAdsFeatured();
        }
Exemplo n.º 2
0
        public ListRecipesPageViewModel(INavigationService navigationService, Services.IDataService dataService, Prism.Services.IPageDialogService pageDialogService)
        {
            _pageDialogService = pageDialogService;
            _navigationService = navigationService;
            _dataService       = dataService;

            Title = "Recipes in meal";
        }
Exemplo n.º 3
0
        public ListMealsPageViewModel(INavigationService navigationService, Services.IDataService dataService, Prism.Services.IPageDialogService pageDialogService)
        {
            _pageDialogService = pageDialogService;
            _navigationService = navigationService;
            _dataService       = dataService;

            Title = "Meals in week";
        }
Exemplo n.º 4
0
 public HomeController(ILogger <HomeController> logger,
                       Services.ICacheService cacheService,
                       Services.IDataService dataService)
 {
     _logger           = logger;
     this.cacheService = cacheService;
     this.dataService  = dataService;
 }
Exemplo n.º 5
0
        public ListWeeksPageViewModel(INavigationService navigationService, Services.IDataService dataService, Prism.Services.IPageDialogService pageDialogService)
        {
            _pageDialogService = pageDialogService;
            _navigationService = navigationService;
            _dataService       = dataService;

            Title = "Weeks for client";
        }
Exemplo n.º 6
0
        public ListIngredientsPageViewModel(INavigationService navigationService, Services.IDataService dataService, Prism.Services.IPageDialogService pageDialogService)
        {
            _pageDialogService = pageDialogService;
            _navigationService = navigationService;
            _dataService       = dataService;

            Title = "Ingredients in recipe";
        }
Exemplo n.º 7
0
        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;
         }
     };
 }
Exemplo n.º 10
0
        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"
            };
        }
Exemplo n.º 11
0
        public ListChefsPageViewModel(INavigationService navigationService, Services.IDataService dataService)
        {
            _navigationService = navigationService;
            _dataService       = dataService;

            PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == nameof(SelectedItem))
                {
                    LoginCommand.RaiseCanExecuteChanged();
                }
            };

            Title = "Please login";
        }
Exemplo n.º 12
0
        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);
            };
        }
Exemplo n.º 13
0
        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;
        }
Exemplo n.º 14
0
        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();
        }
Exemplo n.º 15
0
        /// <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;
        }