示例#1
0
        public SettingsViewModel(
            IMuGetPackageService muGetPackageService,
            INuGetService nuGetService,
            ILogger logger) : base(nuGetService, logger)
        {
            Title = Resources.Settings;

            _muGetPackageService = muGetPackageService;
            MuGetPackages        = new ObservableRangeCollection <MuGetPackage>(_muGetPackageService.GetPackages());

            SettingsItemTappedCommand = new AsyncCommand <SettingItem>(SettingsItemTappedAsync);
            PackageTappedCommand      = new AsyncCommand <MuGetPackage>(async(p) =>
            {
                if (!string.IsNullOrEmpty(p?.PackageId))
                {
                    await Launcher.TryOpenAsync($"muget://package/{p.PackageId}/");
                }
            });
            ResetNotificationsCommand = new Command(ResetNotifications);
            RunJobsCommand            = new AsyncCommand(RunJobsAsync);
        }
示例#2
0
        public SettingsViewModel(
            IBrowser browser,
            ILauncher launcher,
            IDeviceInfo deviceInfo,
            IAppInfo appInfo,
            IVersionTracking versionTracking,
            IEmail email,
            IStoreReview storeReview,
            IMuGetPackageService muGetPackageService,
            IBvmConstructor bvmConstructor) : base(bvmConstructor)
        {
            Title = Resources.Settings;

            _browser         = browser;
            _launcher        = launcher;
            _deviceInfo      = deviceInfo;
            _appInfo         = appInfo;
            _versionTracking = versionTracking;
            _email           = email;

            _storeReview = storeReview;

            _muGetPackageService = muGetPackageService;

            MuGetPackages = new ObservableRangeCollection <MuGetPackage>(_muGetPackageService.GetPackages());

            SettingsItemTappedCommand = new AsyncCommand <SettingItem>(SettingsItemTappedAsync);
            PackageTappedCommand      = new AsyncCommand <MuGetPackage>(async(p) =>
            {
                if (!string.IsNullOrEmpty(p?.PackageId))
                {
                    await _launcher.TryOpenAsync(string.Format(Resources.PackageUrlFormat, p.PackageId));
                }
            });
            ResetNotificationsCommand = new Command(ResetNotifications);
            RunJobsCommand            = new AsyncCommand(RunJobsAsync);
        }