Example #1
0
        public ProViewModel()
        {
            platformHelpers = ServiceContainer.Resolve <IPlatformHelpers>();
            BuyCommand      = new AsyncCommand <string>(PurchasePro);
            RestoreCommand  = new AsyncCommand(RestorePurchases);

#if DEBUG
            CrossInAppBilling.Current.InTestingMode = true;
#endif
        }
Example #2
0
        public TimerViewModel(string id, bool bootStart = false, float bootMins = -1)
        {
            platformHelpers = ServiceContainer.Resolve <IPlatformHelpers>();
            identifier      = id;
            settings        = new Settings(id);
            this.bootMins   = bootMins;

            InitializeFile();

            switch (identifier)
            {
            case Constants.Giveaway:
            case Constants.Countdown2:
            case Constants.Countdown3:
            case Constants.Countdown:
                IsDown = true;
                break;

            case Constants.Countup:
                IsDown = false;
                break;
            }

            StartStopTimerCommand   = new Command(() => ExecuteStartStopTimerCommand(true));
            CopyFilePathCommand     = new AsyncCommand(ExecuteCopyFilePathCommand);
            ResetCommand            = new Command(ExecuteResetCommand);
            AddMinuteCommand        = new Command(ExecuteAddMinuteCommand);
            PauseResumeTimerCommand = new Command(ExecutePauseResumeTimerCommand);
            timer           = new Timer(800);
            timer.Elapsed  += TimerElapsed;
            timer.AutoReset = true;

            if (AutoStart || bootStart)
            {
                ExecuteStartStopTimerCommand();
            }
        }