Exemple #1
0
        private void Current_PageAppearing(object sender, Page e)
        {
            //Defines the current strategy
            if (this.TimerType == TimerFormats.IntegerCounter)
            {
                this.timerStrategy = new IntCounterStrategy();
            }
            else
            {
                this.timerStrategy = new HourMinSecStrategy();
            }

            // Init Timer

            if (this._resetTimerOnAppearing)
            {
                ResetClockOrCounter();
            }
            else
            {
                InitClockOrCounter();
            }

            //if (IsAutoStarted)
            //    this.Start(); // Starts or Resumes the timer
        }
Exemple #2
0
        public FrameTimer()
        {
            _innerLabel = new Label {
                VerticalOptions         = LayoutOptions.Center,
                HorizontalOptions       = LayoutOptions.Center,
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center,
                LineBreakMode           = LineBreakMode.NoWrap,
            };
            this.Content = _innerLabel;

            // Default format Hour:Min:Sec
            this.TimerType     = TimerFormats.HourMinuteSecond;
            this.timerStrategy = new HourMinSecStrategy();

            this.AllowNegativeValues        = false;
            this.ClockFontNegaviteTextColor = Color.Red;

            Application.Current.PageAppearing += Current_PageAppearing;
        }