Ejemplo n.º 1
0
 public void Update()
 {
     // It must be done on UI thread
     var task = _control.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                                             () =>
     {
         _control.Invalidate();
     });
 }
Ejemplo n.º 2
0
        private async Task InvalidateAfterResuming()
        {
            if (canvasControl == null)
            {
                return;
            }

            isSuccessfullyRendered = false;

            for (var i = 0; i < NumRetriesToInvalidate; i++)
            {
                canvasControl?.Invalidate();

                await Task.Delay(WaitingTimeAfterInvalidate);

                if (isSuccessfullyRendered)
                {
                    return;
                }
            }

            RecreateCanvas();
        }