public CreateOfferViewModel(ICanService canService, IWantService wantService, ICategoryService categoryService, IDialogService dialogService, IMessengerService messenger) : base(canService, wantService, categoryService, dialogService, messenger) { Offer = new OfferModel(); if (Categories == null || Categories.Count == 0) { var mtDispatcher = Mvx.Resolve <IMvxMainThreadDispatcher>(); mtDispatcher.RequestMainThreadAction(() => { DialogService.Alert( Constants.DialogNoNetwork, Constants.DialogTitleError, Constants.DialogButtonOk, () => Close(this)); }); return; } Category = -1; }
public EditOfferViewModel(ICanService canService, IWantService wantService, ICategoryService categoryService, IDialogService dialogService, IMessengerService messenger) : base(canService, wantService, categoryService, dialogService, messenger) { }
protected BaseEditOfferViewModel(ICanService canService, IWantService wantService, ICategoryService categoryService, IDialogService dialogService, IMessengerService messenger) { CanService = canService; WantService = wantService; CategoryService = categoryService; DialogService = dialogService; Messenger = messenger; Categories = categoryService.GetCategoryList(); }
private async void LoadData(string user) { User = user.Deserialize <UserModel>(); if (User == null) { return; } Contacts = new List <ContactsEntry> { new ContactsEntry(ContactType.Phone, User.phone), new ContactsEntry(ContactType.Email, User.email), new ContactsEntry(ContactType.VkLink, User.vkLink) }; ICanService canService = Mvx.Resolve <ICanService>(); IWantService wantService = Mvx.Resolve <IWantService>(); var canList = new OfferersOfferList { Header = "Может" }; var userCans = await canService.GetCanListByUser(User.id); canList.AddRange(userCans); var wantList = new OfferersOfferList { Header = "Хочет" }; var userWants = await wantService.GetWantListByUser(User.id); wantList.AddRange(userWants); Offers = new List <OfferersOfferList> { canList, wantList }; }
public AddProductManager(IAddProductDal addProductDal, IProductService productService, IWantService wantService) { _addProductDal = addProductDal; _productService = productService; _wantService = wantService; }
public AllWantsViewModel(IWantService wantService) { _wantService = wantService; Task.Run(LoadData); }