Exemple #1
0
        private void Button_Clicked(object sender, EventArgs e)
        {
            pageVM.IsClear           = !pageVM.IsClear;
            pageVM.DisplayButtonText = pageVM.IsClear ? $"Draw {drawType.ToString()}" : "Clear";

            DrawSKCanvasView.InvalidateSurface();
        }
        async Task AnimationLoop()
        {
            stopwatch.Start();

            while (isRun)
            {
                double cycleTime = MySlider.Value;
                double t         = stopwatch.Elapsed.TotalSeconds % cycleTime / cycleTime;
                scale = (1 + (float)Math.Sin(2 * Math.PI * t)) / 2;
                DrawSKCanvasView.InvalidateSurface();
                await Task.Delay(TimeSpan.FromSeconds(1.0 / 30));
            }

            stopwatch.Stop();
        }