예제 #1
0
        private async void SetUpRound()
        {
            try
            {
                // stop the sound if any is being played
                audio.Stop();

                //stop the timer
                deviceTimer.Stop();
            }
            catch
            {
            }
            // clear the options and answer
            buttons.Clear();
            Answer = "";
            timerGuagePointer.Value = 0;

            // set options : wrap the awaited task within a task to make it wait
            this.buttons = Task.Run(async() => await SetDummmyOptionsAsync()).Result;

            // set new synopsis
            lblSynopsis.Text = Task.Run(async() => await GetAnimeSynopsisAsync()).Result;

            buttons = buttons.OrderBy(a => Guid.NewGuid()).ToList();

            this.frameOption1.Content = buttons[0];
            this.frameOption2.Content = buttons[1];
            this.frameOption3.Content = buttons[2];
            this.frameOption4.Content = buttons[3];


            deviceTimer = new DeviceTimer(StartTimer, TimeSpan.FromSeconds(1), true, true);
        }
예제 #2
0
        private void CloseAll()
        {
            IsCounting = false;

            DependencyService.Get <MessageBoxService>().ShowConfirm(
                $"루틴 종료",
                $"루틴을 종료하시겠습니까?",
                () =>
            {
                IsCounting = true;
            },
                async() =>
            {
                deviceTimer?.Stop();
                await CloseAllNavigationPage();
            });
        }