示例#1
0
        public LoginPageViewModel(
            ILoggingService logging,
            INavigationService navigation,
            IPlatformSpecific device,
            IWallabagClient client,
            IApiClientCreationService apiService,
            SQLiteConnection database)
        {
            _loggingService    = logging;
            _navigationService = navigation;
            _device            = device;
            _client            = client;
            _apiClientService  = apiService;
            _database          = database;

            _loggingService.WriteLine("Creating new instance of LoginPageViewModel.");

            Providers = new List <WallabagProvider>()
            {
                new WallabagProvider(new Uri("https://framabag.org"), "framabag", _device.GetLocalizedResource("FramabagProviderDescription")),
                new WallabagProvider(new Uri("https://app.wallabag.it"), "wallabag.it", _device.GetLocalizedResource("WallabagItProviderDescription")),
                WallabagProvider.GetOther(_device)
            };

            PreviousCommand       = new RelayCommand(() => Previous(), () => PreviousCanBeExecuted());
            NextCommand           = new RelayCommand(async() => await NextAsync(), () => NextCanBeExecuted());
            RegisterCommand       = new RelayCommand(() => _device.LaunchUri((SelectedProvider as WallabagProvider).Url.Append("/register")), () => RegistrationCanBeExecuted());
            WhatIsWallabagCommand = new RelayCommand(() => _device.LaunchUri(new Uri("vimeo://v/167435064"), new Uri("https://vimeo.com/167435064")));
            ScanQRCodeCommand     = new RelayCommand(() => _navigationService.Navigate(Navigation.Pages.QRScanPage));

            this.PropertyChanged += This_PropertyChanged;
        }
示例#2
0
 public OfflineTaskService(IWallabagClient client, SQLiteConnection database, ILoggingService loggingService, IPlatformSpecific platform)
 {
     _client         = client;
     _database       = database;
     _loggingService = loggingService;
     _platform       = platform;
 }
        public ItemPageViewModel(
            IOfflineTaskService offlineTaskService,
            ILoggingService loggingService,
            IPlatformSpecific device,
            INavigationService navigationService,
            IWallabagClient client,
            SQLite.Net.SQLiteConnection database)
        {
            _offlineTaskService = offlineTaskService;
            _loggingService     = loggingService;
            _device             = device;
            _navigationService  = navigationService;
            _client             = client;
            _database           = database;

            _loggingService.WriteLine($"Initializing new instance of {nameof(ItemPageViewModel)}.");

            ChangeReadStatusCommand     = new RelayCommand(() => ChangeReadStatus());
            ChangeFavoriteStatusCommand = new RelayCommand(() => ChangeFavoriteStatus());
            EditTagsCommand             = new RelayCommand(() => _navigationService.Navigate(Navigation.Pages.EditTagsPage, Item.Model.Id));
            DeleteCommand = new RelayCommand(() =>
            {
                _loggingService.WriteLine("Deleting the current item.");
                Item.DeleteCommand.Execute();
                _navigationService.GoBack();
            });

            SaveRightClickLinkCommand          = new RelayCommand(() => _offlineTaskService.AddAsync(RightClickUri.ToString(), new List <string>()));
            OpenRightClickLinkInBrowserCommand = new RelayCommand(() => _device.LaunchUri(RightClickUri));
            CopyLinkToClipboardCommand         = new RelayCommand(() => _device.SetClipboardUri(RightClickUri));
        }
示例#4
0
 public ApiClientCreationService(
     ILoggingService loggingService,
     IWallabagClient client,
     IPlatformSpecific platform)
 {
     _loggingService = loggingService;
     _client         = client;
     _device         = platform;
 }
示例#5
0
 public StartPageViewModel()
 {
     _migrationService  = SimpleIoc.Default.GetInstance <IMigrationService>();
     _database          = SimpleIoc.Default.GetInstance <SQLiteConnection>();
     _navigationService = SimpleIoc.Default.GetInstance <INavigationService>();
     _client            = SimpleIoc.Default.GetInstance <IWallabagClient>();
     _device            = SimpleIoc.Default.GetInstance <IPlatformSpecific>();
     _logging           = SimpleIoc.Default.GetInstance <ILoggingService>();
 }