Beispiel #1
0
 public IAsyncAction HideAsync()
 {
     return(AsyncAction.FromTask(async ct =>
     {
         CoreDispatcher.CheckThreadAccess();
         UIApplication.SharedApplication.StatusBarHidden = true;
         Hiding?.Invoke(this, null);
     }));
 }
Beispiel #2
0
 public IAsyncAction ShowAsync()
 {
     return(AsyncAction.FromTask(async ct =>
     {
         CoreDispatcher.CheckThreadAccess();
         _isShown = true;
         UpdateSystemUiVisibility();
         Showing?.Invoke(this, null);
     }));
 }
Beispiel #3
0
        private async void RefreshImageAsync(Windows.Foundation.Rect drawRect)
        {
            CoreDispatcher.CheckThreadAccess();

            var cd = new CancellationDisposable();

            _refreshPaint.Disposable = cd;

            await RefreshImage(cd.Token, drawRect);
        }
Beispiel #4
0
        /// <summary>
        /// Gets the status bar for the current window (app view).
        /// </summary>
        /// <returns>The status bar for the current window (app view).</returns>
        public static StatusBar GetForCurrentView()
        {
            CoreDispatcher.CheckThreadAccess();
            if (_statusBar == null)
            {
                _statusBar = new StatusBar();
            }

            return(_statusBar);
        }
        public IVectorView <object> GetView()
        {
            IVectorView <object> spResult;

            CoreDispatcher.CheckThreadAccess();             // CheckThread();

            spResult = new TrackerView <object>();
            (spResult as TrackerView <object>).SetCollection(this);

            return(spResult);
        }
Beispiel #6
0
        private async void OpenImageAsync(ImageSource newValue)
        {
            CoreDispatcher.CheckThreadAccess();

            using var cd = new CancellationDisposable();
            _imageScheduler.Disposable = cd;

            var image = await Task.Run(() => newValue.Open(cd.Token), cd.Token);

            if (cd.Token.IsCancellationRequested)
            {
                return;
            }

            SetImage(image);
        }
Beispiel #7
0
        public T GetDeferral()
        {
            _deferralsCount++;
            var isCompleted = false;

            return(_deferralFactory(OnDeferralCompleted));

            void OnDeferralCompleted()
            {
#if !__WASM__ // Disable check on WASM until threading is supported
                CoreDispatcher.CheckThreadAccess();
#endif
                if (isCompleted)
                {
                    throw new InvalidOperationException("Deferral already completed.");
                }

                isCompleted = true;
                DeferralCompleted();
            }
        }
Beispiel #8
0
 public void ExitFullScreenMode()
 {
     CoreDispatcher.CheckThreadAccess();
     UpdateFullScreenMode(false);
 }
Beispiel #9
0
 public bool TryEnterFullScreenMode()
 {
     CoreDispatcher.CheckThreadAccess();
     UpdateFullScreenMode(true);
     return(true);
 }
Beispiel #10
0
 public void ExitFullScreenMode()
 {
     CoreDispatcher.CheckThreadAccess();
     UIApplication.SharedApplication.StatusBarHidden = false;
 }
Beispiel #11
0
 public bool TryEnterFullScreenMode()
 {
     CoreDispatcher.CheckThreadAccess();
     UIApplication.SharedApplication.StatusBarHidden = true;
     return(UIApplication.SharedApplication.StatusBarHidden);
 }
Beispiel #12
0
 private void CheckThread() => CoreDispatcher.CheckThreadAccess();
Beispiel #13
0
 // BEGIN UNO Specific
 protected void CheckThread() => CoreDispatcher.CheckThreadAccess();