public AccountInfoViewModel(IProfileProvider profileProvider, ICredentialsProvider credentialsProvider, IDataCacheService dataCacheService, IFileCacheService fileCacheService, INavigationService navigationService, INotificationsProvider notificationsProvider, IBookmarksProvider bookmarksProvider, ICatalogProvider catalogProvider, IBookProvider bookProvider, ICatalitClient client, ILitresPurchaseService purchaseService) { _navigationService = navigationService; _profileProvider = profileProvider; _credentialsProvider = credentialsProvider; _dataCacheService = dataCacheService; _fileCacheService = fileCacheService; _notificationsProvider = notificationsProvider; _bookmarksProvider = bookmarksProvider; _catalogProvider = catalogProvider; _bookProvider = bookProvider; _client = client; _purchaseService = purchaseService; RegisterAction(ClearUserInfoPart).AddPart(ClearUserInfoProceed, session => true); RegisterAction(AddToDepositPart).AddPart(AddToDepositProceed, session => true); RegisterAction(LoadUserInfoPart).AddPart(LoadUserInfoProceed, session => session.Parameters.GetValue<UserInformation>(ChangeUserInfoParameter, null) == null); ClearData = new RelayCommand(ClearUserInfo); ReloadInfo = new RelayCommand(ReloadUserInfo); AddToDeposit = new RelayCommand<DepositType>(dt => AddToDepositFunc(dt)); Deposits = new List<Deposit> { new Deposit { LitresPrice = "105 руб.", RealPrice = "149 руб." }, new Deposit { LitresPrice = "189 руб.", RealPrice = "269 руб." }, new Deposit { LitresPrice = "304 руб.", RealPrice = "434 руб." }}; }
public BookmarksViewModel(IBookmarksProvider bookmarksProvider, ICatalogProvider catalogProvider, INavigationService navigationService) { _bookmarksProvider = bookmarksProvider; _catalogProvider = catalogProvider; _navigationService = navigationService; RegisterPart( MainPart, ( session, part ) => LoadBookmarks( session ), ( session, part ) => true ); //RegisterPart( DeletePart, ( session, part ) => DeleteBookmarks( session ), ( session, part ) => true, false ); Bookmarks = new XCollection<Bookmark>(); BookmarkedBooks = new XCollection<Book>(); BookSelected = new RelayCommand<Book>( book => _navigationService.Navigate( "BookBookmarks", Parameters.From( "id", book.Id )), book => book != null ); }
public AuthorizationViewModel( ICredentialsProvider credentialsProvider, IProfileProvider profileProvider, INavigationService navigationService, INotificationsProvider notificationsProvider, IDataCacheService dataCacheService, IFileCacheService fileCacheService, IBookmarksProvider bookmarksProvider, ICatalogProvider catalogProvider, IBookProvider bookProvider) { _credentialsProvider = credentialsProvider; _navigationService = navigationService; _profileProvider = profileProvider; _notificationsProvider = notificationsProvider; _dataCacheService = dataCacheService; _fileCacheService = fileCacheService; _bookmarksProvider = bookmarksProvider; _catalogProvider = catalogProvider; _bookProvider = bookProvider; RegisterAction(MainPart).AddPart(LoadCredential, session => true); RegisterAction(LoginPart).AddPart(LoginProceed, session => true); }