protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            listener   = new HearthRateListener();
            lsOperator = LedSoundOperator.GetBlinker();
            var blinker = Blinker.GetBlinker();

            listener.PulseDataReceived += (p, q) =>
            {
                blinker.HeartRate = q.HeartRate;
            };
            blinker.DoBlink += Blinker_DoBlink;
            blinker.Start();
            await listener.Init();
        }
Esempio n. 2
0
        private async Task Init()
        {
            if (model == null)
            {
                model = new HeartRateModel();
                await model.Init();

                model.BandDataReceived  += (p, q) => FlashCircle(BandDataCircle, Colors.Gold, 100);
                model.PulseDataReceived += (p, q) => FlashCircle(AzureDataCircle, Colors.Gold, 100);

                var blinker = Blinker.GetBlinker();
                model.PulseDataReceived += (p, q) =>
                {
                    blinker.HeartRate = q.HeartRate;
                };
                blinker.DoBlink += BlinkerDoBlink;
                blinker.Start();
            }
        }
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     lsOperator.Cleanup();
     Blinker.GetBlinker().Stop();
 }