public void Update() { // It must be done on UI thread var task = _control.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { _control.Invalidate(); }); }
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(); }