Пример #1
0
 public DeviceActionService(
     IAppSettingsService appSettingsService,
     IDeviceInfoService deviceInfoService)
 {
     _appSettingsService = appSettingsService;
     _deviceInfoService  = deviceInfoService;
 }
Пример #2
0
        public ProtoService(BackgroundTaskDeferral deferral, IDeviceInfoService deviceInfoService)
        {
            Log.SetFilePath(Path.Combine(ApplicationData.Current.LocalFolder.Path, "log"));

            _deferral = deferral;

            _client            = Client.Create(this);
            _deviceInfoService = deviceInfoService;

            var parameters = new TdlibParameters
            {
                DatabaseDirectory  = ApplicationData.Current.LocalFolder.Path,
                UseSecretChats     = true,
                UseMessageDatabase = true,
                ApiId              = Telegram.Api.Constants.ApiId,
                ApiHash            = Telegram.Api.Constants.ApiHash,
                SystemLanguageCode = "en",
                DeviceModel        = _deviceInfoService.DeviceModel,
                SystemVersion      = _deviceInfoService.SystemVersion,
                ApplicationVersion = _deviceInfoService.AppVersion
            };

            Task.Run(() =>
            {
                _client.Send(new SetTdlibParameters(parameters));
                _client.Send(new CheckDatabaseEncryptionKey(new byte[0]));
                _client.Run();
            });
        }
 public XamarinSessionFactory(
     IDeviceInfoService deviceInfoService,
     IApplicationInfoService applicationInfoService)
 {
     _deviceInfoService      = deviceInfoService;
     _applicationInfoService = applicationInfoService;
 }
        public MainPage(IDeviceInfoService deviceInfoService)
        {
            var t   = deviceInfoService.AppDataFolder;
            var sd3 = deviceInfoService.DeviceUniqueIdentifier;

            InitializeComponent();
        }
Пример #5
0
        public ToolsPage()
        {
            _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>();
            _deviceInfoService      = Resolver.Resolve <IDeviceInfoService>();

            Init();
        }
        public VaultAutofillListLoginsPage(string uriString)
            : base(true)
        {
            Uri = uriString;

            Uri        uri;
            DomainName domainName;

            if (!System.Uri.TryCreate(uriString, UriKind.Absolute, out uri) ||
                !DomainName.TryParse(uri.Host, out domainName))
            {
                if (uriString != null && uriString.StartsWith(Constants.AndroidAppProtocol))
                {
                    _name = uriString.Substring(Constants.AndroidAppProtocol.Length);
                }
            }
            else
            {
                _name = domainName.BaseDomain;
            }

            _loginService          = Resolver.Resolve <ILoginService>();
            _deviceInfoService     = Resolver.Resolve <IDeviceInfoService>();
            _clipboardService      = Resolver.Resolve <IClipboardService>();
            _settingsService       = Resolver.Resolve <ISettingsService>();
            UserDialogs            = Resolver.Resolve <IUserDialogs>();
            GoogleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>();

            Init();
        }
Пример #7
0
        public IoTDeviceClientService(IAppConfigService appConfigService, IDeviceInfoService deviceInfoService)
        {
            _appConfigService  = appConfigService;
            _deviceInfoService = deviceInfoService;

            LastKnownConnectionStatus = Microsoft.Azure.Devices.Client.ConnectionStatus.Disconnected;
        }
Пример #8
0
        public HomeViewModel(IConnectionService connectionService,
                             INavigationService navigationService,
                             IDialogService dialogService,
                             IUsersDataService usersService,
                             ISettingsService settingsService,
                             IMasiniService masiniService,
                             IComenziService orderService,
                             IArticoleService articleService,
                             IPhaseService phaseService,
                             IJobDataService jobDataService,
                             IDeviceDataService deviceDataService,
                             IDeviceInfoService deviceInfoService)

            : base(connectionService, navigationService, dialogService)
        {
            _masiniService     = masiniService;
            _settingsService   = settingsService;
            _orderService      = orderService;
            _articleService    = articleService;
            _phaseService      = phaseService;
            _jobDataService    = jobDataService;
            _usersService      = usersService;
            _deviceDataService = deviceDataService;
            _deviceInfoService = deviceInfoService;
        }
Пример #9
0
 public HomeViewModel(IDeviceInfoService deviceInfo, IUserDialogService dialogs)
 {
     this.Menu = new List<MenuItemViewModel> {
         new MenuItemViewModel(
             "Barcode Scanning",
             () => {
                 if (deviceInfo.IsRearCameraAvailable) {
                     this.ShowViewModel<BarCodeViewModel>();
                 }
                 else {
                     dialogs.Alert("Rear camera is unavailable");
                 }
             }
         ),
         new MenuItemViewModel(
             "Device Info",
             () => this.ShowViewModel<DeviceInfoViewModel>()
         ),
         new MenuItemViewModel(
             "Dialogs",
             () => this.ShowViewModel<DialogsViewModel>()
         ),
         new MenuItemViewModel(
             "Network",
             () => this.ShowViewModel<NetworkViewModel>()
         ),
         new MenuItemViewModel(
             "Settings",
             () => this.ShowViewModel<SettingsViewModel>()
         )
     };
 }
Пример #10
0
 public AuthService(
     ISecureStorageService secureStorage,
     ITokenService tokenService,
     ISettings settings,
     IAppSettingsService appSettingsService,
     ICryptoService cryptoService,
     IConnectApiRepository connectApiRepository,
     IAccountsApiRepository accountsApiRepository,
     IAppIdService appIdService,
     IDeviceInfoService deviceInfoService,
     IDeviceApiRepository deviceApiRepository,
     IGoogleAnalyticsService googleAnalyticsService)
 {
     _secureStorage          = secureStorage;
     _tokenService           = tokenService;
     _settings               = settings;
     _appSettingsService     = appSettingsService;
     _cryptoService          = cryptoService;
     _connectApiRepository   = connectApiRepository;
     _accountsApiRepository  = accountsApiRepository;
     _appIdService           = appIdService;
     _deviceInfoService      = deviceInfoService;
     _deviceApiRepository    = deviceApiRepository;
     _googleAnalyticsService = googleAnalyticsService;
 }
Пример #11
0
        public VaultAutofillListCiphersPage(AppOptions appOptions)
            : base(true)
        {
            _appOptions = appOptions;
            Uri         = appOptions.Uri;
            if (Uri.StartsWith(Constants.AndroidAppProtocol))
            {
                _name = Uri.Substring(Constants.AndroidAppProtocol.Length);
            }
            else if (!System.Uri.TryCreate(Uri, UriKind.Absolute, out Uri uri) ||
                     !DomainName.TryParseBaseDomain(uri.Host, out _name))
            {
                _name = "--";
            }

            _cipherService         = Resolver.Resolve <ICipherService>();
            _deviceInfoService     = Resolver.Resolve <IDeviceInfoService>();
            DeviceActionService    = Resolver.Resolve <IDeviceActionService>();
            _settingsService       = Resolver.Resolve <ISettingsService>();
            _appSettingsService    = Resolver.Resolve <IAppSettingsService>();
            GoogleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>();
            _connectivity          = Resolver.Resolve <IConnectivity>();

            Init();
        }
		public NotificationsProvider(ICatalitClient client, 
            IDeviceInfoService deviceInfoService, 
            IDataCacheService dataCacheService)
		{
			_client = client;
			_dataCacheService = dataCacheService;
			_deviceInfoService = deviceInfoService;
		}
Пример #13
0
        public ToolsPage(MainPage mainPage)
        {
            _mainPage = mainPage;
            _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>();
            _deviceInfoService      = Resolver.Resolve <IDeviceInfoService>();

            Init();
        }
Пример #14
0
 public BookProvider(ISessionAwareConnection awareConnection, IDataCacheService dataCacheService, IFileCacheService fileCacheService, IDeviceInfoService deviceInfoService, IFileDownloadService fileDownloadService, ISessionEstablisherService sessionEstablisherService)
 {
     _fileCacheService = fileCacheService;
     _dataCacheService = dataCacheService;
     _awareConnection = awareConnection;
     _deviceInfoService = deviceInfoService;
     _fileDownloadService = fileDownloadService;
     _sessionEstablisherService = sessionEstablisherService;
 }
        public LitresPurchaseService( ICatalogProvider catalogProvider, ICredentialsProvider credentialsProvider, IProfileProvider profileProvider, IInAppPurchaseService inAppPurchaseSevice, ICatalitClient client, IPurchaseServiceDecorator purchaseServiceDecorator, IDeviceInfoService deviceInfoService)
		{
			_inAppPurchaseService = inAppPurchaseSevice;
			_client = client;
			_catalogProvider = catalogProvider;
			_credentialsProvider = credentialsProvider;
			_profileProvider = profileProvider;
			_purchaseServiceDecorator = purchaseServiceDecorator;
			_deviceInfoService = deviceInfoService;
		}
Пример #16
0
        public LockFingerprintPage(bool checkFingerprintImmediately)
        {
            _checkFingerprintImmediately = checkFingerprintImmediately;
            _fingerprint       = Resolver.Resolve <IFingerprint>();
            _settings          = Resolver.Resolve <ISettings>();
            _appSettings       = Resolver.Resolve <IAppSettingsService>();
            _deviceInfoService = Resolver.Resolve <IDeviceInfoService>();

            Init();
        }
Пример #17
0
        public ProtoService(int session, IDeviceInfoService deviceInfoService, ISettingsService settings, IEventAggregator aggregator)
        {
            _session           = session;
            _deviceInfoService = deviceInfoService;
            _settings          = settings;
            _aggregator        = aggregator;

            _preferences = new AutoDownloadPreferences(ApplicationData.Current.LocalSettings.CreateContainer("autoDownload", ApplicationDataCreateDisposition.Always));

            Initialize();
        }
        public DeviceFeaturesPage()
        {
            InitializeComponent();

            _vibrateService         = Injector.Get <IVibrateService>();
            _deviceInfoService      = Injector.Get <IDeviceInfoService>();
            _statusBarService       = Injector.Get <IStatusBarService>();
            _localStorageService    = Injector.Get <ILocalStorageService>();
            _personalizationService = Injector.Get <IPersonalizationService>();
            _dialogService          = Injector.Get <IDialogService>();
        }
Пример #19
0
        public VaultEditLoginPage(string loginId)
        {
            _loginId                = loginId;
            _loginService           = Resolver.Resolve <ILoginService>();
            _folderService          = Resolver.Resolve <IFolderService>();
            _userDialogs            = Resolver.Resolve <IUserDialogs>();
            _connectivity           = Resolver.Resolve <IConnectivity>();
            _deviceInfo             = Resolver.Resolve <IDeviceInfoService>();
            _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>();

            Init();
        }
Пример #20
0
        public LoginTwoFactorPage()
            : base(updateActivity: false)
        {
            _cryptoService     = Resolver.Resolve <ICryptoService>();
            _authService       = Resolver.Resolve <IAuthService>();
            _deviceInfoService = Resolver.Resolve <IDeviceInfoService>();
            _appIdService      = Resolver.Resolve <IAppIdService>();
            _userDialogs       = Resolver.Resolve <IUserDialogs>();
            _syncService       = Resolver.Resolve <ISyncService>();

            Init();
        }
Пример #21
0
        public VaultEditCipherPage(string cipherId)
        {
            _cipherId               = cipherId;
            _cipherService          = Resolver.Resolve <ICipherService>();
            _folderService          = Resolver.Resolve <IFolderService>();
            _userDialogs            = Resolver.Resolve <IUserDialogs>();
            _connectivity           = Resolver.Resolve <IConnectivity>();
            _deviceInfo             = Resolver.Resolve <IDeviceInfoService>();
            _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>();

            Init();
        }
Пример #22
0
        // TODO: Model binding context?

        public SettingsPage()
        {
            _authService            = Resolver.Resolve <IAuthService>();
            _userDialogs            = Resolver.Resolve <IUserDialogs>();
            _settings               = Resolver.Resolve <ISettings>();
            _fingerprint            = Resolver.Resolve <IFingerprint>();
            _pushNotification       = Resolver.Resolve <IPushNotificationService>();
            _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>();
            _deviceInfoService      = Resolver.Resolve <IDeviceInfoService>();

            Init();
        }
        public ProtoService(int session, IDeviceInfoService deviceInfoService, ISettingsService settings, IEventAggregator aggregator)
        {
            Log.SetVerbosityLevel(ApplicationSettings.Current.VerbosityLevel);
            Log.SetFilePath(Path.Combine(ApplicationData.Current.LocalFolder.Path, $"{session}", "log"));

            _session           = session;
            _deviceInfoService = deviceInfoService;
            _aggregator        = aggregator;

            _preferences = new AutoDownloadPreferences(ApplicationData.Current.LocalSettings.CreateContainer("autoDownload", ApplicationDataCreateDisposition.Always));

            Initialize();
        }
Пример #24
0
        // TODO: Model binding context?

        public SettingsPage(MainPage mainPage)
        {
            _mainPage               = mainPage;
            _authService            = Resolver.Resolve <IAuthService>();
            _settings               = Resolver.Resolve <ISettings>();
            _fingerprint            = Resolver.Resolve <IFingerprint>();
            _pushNotification       = Resolver.Resolve <IPushNotificationService>();
            _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>();
            _deviceActionService    = Resolver.Resolve <IDeviceActionService>();
            _deviceInfoService      = Resolver.Resolve <IDeviceInfoService>();
            _lockService            = Resolver.Resolve <ILockService>();

            Init();
        }
        public UserAgentDetectorItem detectUserAgent([FromQuery(Name = "ua")] string userAgent = "")
        {
            if (string.IsNullOrEmpty(userAgent))
            {
                userAgent = Request.Headers["User-Agent"];
            }
            IDeviceInfoService deviceInfoService = Request.HttpContext.RequestServices.GetService <IDeviceInfoService>();

            deviceInfoService = Request.HttpContext.RequestServices.GetService <IDeviceInfoService>();

            deviceInfoService = Request.HttpContext.RequestServices.GetService <IDeviceInfoService>();

            return(deviceInfoService.getInfo(userAgent));
        }
Пример #26
0
        public LoginPage(string email = null)
            : base(updateActivity: false)
        {
            _email                  = email;
            _cryptoService          = Resolver.Resolve <ICryptoService>();
            _authService            = Resolver.Resolve <IAuthService>();
            _deviceInfoService      = Resolver.Resolve <IDeviceInfoService>();
            _appIdService           = Resolver.Resolve <IAppIdService>();
            _userDialogs            = Resolver.Resolve <IUserDialogs>();
            _syncService            = Resolver.Resolve <ISyncService>();
            _settings               = Resolver.Resolve <ISettings>();
            _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>();
            _pushNotification       = Resolver.Resolve <IPushNotification>();

            Init();
        }
Пример #27
0
        public VaultAddLoginPage(string defaultUri = null, string defaultName = null, bool fromAutofill = false)
        {
            _defaultUri   = defaultUri;
            _defaultName  = defaultName;
            _fromAutofill = fromAutofill;

            _loginService           = Resolver.Resolve <ILoginService>();
            _folderService          = Resolver.Resolve <IFolderService>();
            _userDialogs            = Resolver.Resolve <IUserDialogs>();
            _connectivity           = Resolver.Resolve <IConnectivity>();
            _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>();
            _settings       = Resolver.Resolve <ISettings>();
            _appInfoService = Resolver.Resolve <IAppInfoService>();
            _deviceInfo     = Resolver.Resolve <IDeviceInfoService>();

            Init();
        }
        public VaultListGroupingsPage()
            : base(true)
        {
            _folderService          = Resolver.Resolve <IFolderService>();
            _collectionService      = Resolver.Resolve <ICollectionService>();
            _cipherService          = Resolver.Resolve <ICipherService>();
            _connectivity           = Resolver.Resolve <IConnectivity>();
            _deviceActionService    = Resolver.Resolve <IDeviceActionService>();
            _syncService            = Resolver.Resolve <ISyncService>();
            _pushNotification       = Resolver.Resolve <IPushNotificationService>();
            _deviceInfoService      = Resolver.Resolve <IDeviceInfoService>();
            _settings               = Resolver.Resolve <ISettings>();
            _appSettingsService     = Resolver.Resolve <IAppSettingsService>();
            _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>();

            Init();
        }
Пример #29
0
 public MainWindowViewModel(
     IAppService appService,
     IDataserviceProvider dataserviceProvider,
     IDesignNavigationService navigationService,
     IFileDialogService fileDialogService,
     IRecentFilesDataservice recentFilesDataservice,
     Prism.Services.Dialogs.IDialogService dialogService,
     NatCruise.Services.IDialogService cruiseDialogService,
     IDeviceInfoService deviceInfo)
 {
     AppService             = appService ?? throw new ArgumentNullException(nameof(appService));
     DataserviceProvider    = dataserviceProvider ?? throw new ArgumentNullException(nameof(dataserviceProvider));
     DialogService          = dialogService ?? throw new ArgumentNullException(nameof(dialogService));
     FileDialogService      = fileDialogService ?? throw new ArgumentNullException(nameof(fileDialogService));
     RecentFilesDataservice = recentFilesDataservice ?? throw new ArgumentNullException(nameof(recentFilesDataservice));
     NavigationService      = navigationService ?? throw new ArgumentNullException(nameof(navigationService));
     DeviceInfoService      = deviceInfo ?? throw new ArgumentNullException(nameof(deviceInfo));
     CruiseDialogService    = cruiseDialogService ?? throw new ArgumentNullException(nameof(cruiseDialogService));
 }
Пример #30
0
 //public HomeViewModel(IDeviceInfoService deviceInfo, IUserDialogService dialogs) {
 public HomeViewModel(IDeviceInfoService deviceInfo, IUserDialogService dialogs)
 {
     this.Menu = new List <MenuItemViewModel> {
         new MenuItemViewModel(
             "Barcode Scanning",
             () => {
             if (deviceInfo.IsRearCameraAvailable)
             {
                 this.ShowViewModel <BarCodeViewModel>();
             }
             else
             {
                 dialogs.Alert("Rear camera is unavailable");
             }
         }
             ),
         new MenuItemViewModel(
             "Barcode Creation",
             () => this.ShowViewModel <BarCodeCreateViewModel>()
             ),
         new MenuItemViewModel(
             "Signature List",
             () => this.ShowViewModel <SignatureListViewModel>()
             ),
         new MenuItemViewModel(
             "Device Info",
             () => this.ShowViewModel <DeviceInfoViewModel>()
             ),
         new MenuItemViewModel(
             "Dialogs",
             () => this.ShowViewModel <DialogsViewModel>()
             ),
         new MenuItemViewModel(
             "Network",
             () => this.ShowViewModel <NetworkViewModel>()
             ),
         new MenuItemViewModel(
             "Settings",
             () => this.ShowViewModel <SettingsViewModel>()
             )
     };
 }
Пример #31
0
        public VaultListSitesPage(bool favorites)
            : base(true)
        {
            _favorites         = favorites;
            _folderService     = Resolver.Resolve <IFolderService>();
            _siteService       = Resolver.Resolve <ISiteService>();
            _connectivity      = Resolver.Resolve <IConnectivity>();
            _userDialogs       = Resolver.Resolve <IUserDialogs>();
            _clipboardService  = Resolver.Resolve <IClipboardService>();
            _syncService       = Resolver.Resolve <ISyncService>();
            _pushNotification  = Resolver.Resolve <IPushNotification>();
            _deviceInfoService = Resolver.Resolve <IDeviceInfoService>();
            _settings          = Resolver.Resolve <ISettings>();

            var cryptoService = Resolver.Resolve <ICryptoService>();

            _loadExistingData = !_settings.GetValueOrDefault(Constants.FirstVaultLoad, true) || !cryptoService.KeyChanged;

            Init();
        }
Пример #32
0
        public LoginTwoFactorPage(string email, string masterPasswordHash, byte[] key)
            : base(updateActivity: false)
        {
            _email = email;
            _masterPasswordHash = masterPasswordHash;
            _key = key;

            _cryptoService          = Resolver.Resolve <ICryptoService>();
            _authService            = Resolver.Resolve <IAuthService>();
            _tokenService           = Resolver.Resolve <ITokenService>();
            _deviceInfoService      = Resolver.Resolve <IDeviceInfoService>();
            _appIdService           = Resolver.Resolve <IAppIdService>();
            _userDialogs            = Resolver.Resolve <IUserDialogs>();
            _syncService            = Resolver.Resolve <ISyncService>();
            _settings               = Resolver.Resolve <ISettings>();
            _googleAnalyticsService = Resolver.Resolve <IGoogleAnalyticsService>();
            _pushNotification       = Resolver.Resolve <IPushNotification>();

            Init();
        }
Пример #33
0
 public CipherService(
     ICipherRepository cipherRepository,
     ICipherCollectionRepository cipherCollectionRepository,
     IAttachmentRepository attachmentRepository,
     IAuthService authService,
     ICipherApiRepository cipherApiRepository,
     ISettingsService settingsService,
     ICryptoService cryptoService,
     IAppSettingsService appSettingsService,
     IDeviceInfoService deviceInfoService)
 {
     _cipherRepository           = cipherRepository;
     _cipherCollectionRepository = cipherCollectionRepository;
     _attachmentRepository       = attachmentRepository;
     _authService         = authService;
     _cipherApiRepository = cipherApiRepository;
     _settingsService     = settingsService;
     _cryptoService       = cryptoService;
     _appSettingsService  = appSettingsService;
     _deviceInfoService   = deviceInfoService;
 }
Пример #34
0
        public static void UpdateListViewLayoutDefinition(this RadListView listView, int imageWidth, int listViewMargins, int padding, int itemSpacing)
        {
            var definition = listView.LayoutDefinition as Telerik.XamarinForms.DataControls.ListView.ListViewGridLayout;

            switch (Device.RuntimePlatform)
            {
            case Device.iOS:
                itemSpacing /= 2;
                break;

            case Device.UWP:
                itemSpacing = itemSpacing * 2 + 25;     // because of native control margins and paddings
                break;
            }

            IDeviceInfoService deviceInfo = DependencyService.Get <IDeviceInfoService>();

            var screenSize = deviceInfo.GetScreenSize();

            definition.SpanCount = (int)Math.Floor(((screenSize.Width / deviceInfo.PixelDensity) - listViewMargins) / (imageWidth + 2 * padding + itemSpacing) + 0.03);
        }
Пример #35
0
        public CatalogProvider(ICatalitClient client, IFileDownloadService fileDownloadService, IProfileProvider profileProvider, IBookProvider bookProvider, IDataCacheService dataCacheService, INetworkAvailabilityService networkAvailabilityService, IDeviceInfoService deviceInfoService)
		{
			_client = client;
			_dataCacheService = dataCacheService;
			_fileDownloadService = fileDownloadService;
			_bookProvider = bookProvider;
            _networkAvailabilityService = networkAvailabilityService;
			_myBooksIds = new List<int>();
			_myHistoryBooksIds = new List<int>();
            _profileProvider = profileProvider;
            _deviceInfoService = deviceInfoService;
            //_expirationGuardian = expirationGuardian;
		}
Пример #36
0
 public HomeController(IDealerService ds, IDeviceInfoService dis)
 {
     this.ds = ds;
     this.dis = dis;
 }
 public DeviceInfoViewModel(IDeviceInfoService deviceInfo) {
     this.Device = deviceInfo;
 }
Пример #38
0
 public AskReviewViewModel(IDataCacheService dataCacheService, INavigationService navigationService, IDeviceInfoService deviceInfoService)
 {
     _dataCacheService = dataCacheService;
     _navigationService = navigationService;
     _deviceInfoService = deviceInfoService;
 }
Пример #39
0
        public ProfileProvider(ICatalitClient client, IDeviceInfoService deviceInfoService)
		{
			_client = client;
			_deviceInfoService = deviceInfoService;
		}
Пример #40
0
        public MainViewModel(
         //   IExpirationGuardian expirationGuardian, 
            IProfileProvider profileProvider, 
            IGenresProvider genresProvider, 
            ICatalogProvider catalogProvider, 
            ICredentialsProvider credentialsProvider,
            IBookProvider bookProvider,
            INavigationService navigationService, 
            INetworkAvailabilityService networkAvailability,
            IDeviceInfoService deviceInfoService, ILitresPurchaseService litresPurchaseService)
        {            
            _genresProvider = genresProvider;
			_catalogProvider = catalogProvider;
			_credentialsProvider = credentialsProvider;
			_profileProvider = profileProvider;
			_bookProvider = bookProvider;
			_navigationService = navigationService;
		//    _expirationGuardian = expirationGuardian;
		    _networkAvailability = networkAvailability;
            _deviceInfoService = deviceInfoService;
            _litresPurchaseService = litresPurchaseService;

            var deviceFamily = _deviceInfoService.DeviceFamily;
            if (!string.IsNullOrEmpty(deviceFamily) && deviceFamily.Equals("Windows.Desktop"))
            {
                _booksPerPage = 30;
            }
            ////MyBooks reload allways, may change account information
            RegisterAction(BuyBookPart).AddPart((session) => BuyBookAsync(session, Book), (session) => true);
            RegisterAction(GiftBookPart).AddPart((session) => GetGiftAsync(session, Book), (session) => true);
            RegisterAction(MyBooksPart).AddPart( LoadMyBooks, session => true);
            RegisterAction(BuyBookLitresPart).AddPart((session) => BuyBookFromLitres(session, Book), (session) => true);
            RegisterAction(CreditCardInfoPart).AddPart(session => CreditCardInfoAsync(session), (session) => true);
            RegisterAction(LoadMoreNoveltyBooksPart).AddPart(session => LoadNoveltyBooks(session), session => true);
            RegisterAction(LoadMorePopularBooksPart).AddPart(session => LoadPopularBooks(session), session => true);
            RegisterAction(LoadMoreInterestingBooksPart).AddPart(session => LoadInterestingBooks(session), session => true);
            RegisterAction(MyOffersPart).AddPart(LoadOffers, session => true);
            //RegisterPart(MyBooksPart, (session, part) => LoadMyBooks(session), (session, part) => true, false);
            ////RegisterPart(NewBooksPart, (session, part) => LoadNewBooks(session), (session, part) => true, false);

            MyBooksViewState = MyBooksViewStateEnum.Loading;

			Genres = new XCollection<Genre>();
			Banners = new XCollection<Banner>();

			_myBooks = new XCollection<Book>();
			_noveltyBooks = new XCollection<Book>();
			_popularBooks = new XCollection<Book>();
			_interestingBooks = new XCollection<Book>();

			MyBooks = new XSubRangeCollection<Book>(_myBooks, 0, 10);
            
            NoveltyBooks = new XCollection<Book>();
			PopularBooks = new XCollection<Book>();
			InterestingBooks = new XCollection<Book>();
			ShowMyBooks = new RelayCommand( ToMyBooks );
            BookSelected = new RelayCommand<Book>(book =>  _navigationService.Navigate("Book", XParameters.Create("BookEntity", book)), book => book != null);
            BuyBook = new RelayCommand<Book>(BuyBookFromLitresAsync);
            GiftBook = new RelayCommand<Book>(GiftBookFromLitresAsync);
            ShowInterestingBooks = new RelayCommand(() => _navigationService.Navigate("BooksByCategory", XParameters.Create("category", (int) BooksByCategoryViewModel.BooksViewModelTypeEnum.Interesting)));
			ShowPopularBooks = new RelayCommand(() => _navigationService.Navigate("BooksByCategory", XParameters.Create("category", (int) BooksByCategoryViewModel.BooksViewModelTypeEnum.Popular)));
			ShowNewBooks = new RelayCommand(() => _navigationService.Navigate("BooksByCategory", XParameters.Create("category", (int) BooksByCategoryViewModel.BooksViewModelTypeEnum.Novelty)));
            LoadMoreNoveltyBooks = new RelayCommand(LoadMoreNoveltyBooksProceed, () => true);
            LoadMorePopularBooks = new RelayCommand(LoadMorePopularBooksProceed, () => true);
            LoadMoreInterestingBooks = new RelayCommand(LoadMoreInterestingBooksProceed, () => true);
            GenreSelected = new RelayCommand<int>(ChooseGenre);
			ShowSearchHistory = new RelayCommand(() => _navigationService.Navigate("Search"));
            BuyBookFromMicrosoft = new RelayCommand(BuyBookFromMicrosoftAsync);
            Read = new RelayCommand<Book>(book =>
            {
                if (!book.IsExpiredBook)
                    _navigationService.Navigate("Reader", XParameters.Create("BookEntity", book), false);
                else new MessageDialog("Истёк срок выдачи.").ShowAsync();
            });

            ShowAuthorization = new RelayCommand(() => _navigationService.Navigate("Authorization"));
            ShowRegistration = new RelayCommand(() => _navigationService.Navigate("Registration"));
			ShowUserInfo = new RelayCommand( ToUserInfo );
            RunCreditCardPaymentProcess = new RelayCommand(CreditCardInfo);
           
            ShowAccountInfo = new RelayCommand(ToAccountInfo);
			ShowSettings = new RelayCommand(() => _navigationService.Navigate("Settings"));
			ShowBookmarks = new RelayCommand( () => _navigationService.Navigate( "Bookmarks" ) );
			ShowAbout = new RelayCommand( () => _navigationService.Navigate( "About" ) );
			ShowNotifications = new RelayCommand(() => _navigationService.Navigate("NotificationsEdit"));
            ShowCreditCardView = new RelayCommand<Book>(book => _navigationService.Navigate("CreditCardPurchase", XParameters.Create("BookEntity", book)), book => book != null);

            ShowAppSettings = new RelayCommand(ToAppSettings);

            //_expirationGuardian.StartGuardian();		    
        }