public void Stop()
 {
     if (workItem != null && workItem.Status == Windows.Foundation.AsyncStatus.Started)
     {
         workItem.Cancel();
     }
 }
Example #2
0
 void StopRenderLoop()
 {
     if (_renderLoopWorker != null)
     {
         _swapChainEvent.Set();
         _renderLoopWorker.Cancel();
         _renderLoopWorker = null;
     }
 }
 private void Button_Click_3(object sender, RoutedEventArgs e)
 {
     try
     {
         task.Cancel();
     }
     catch (System.NullReferenceException)
     {}
 }
Example #4
0
        /// <summary>
        /// Cancels posted PropertyChanged events if it is cancellable.
        /// This method must be called on the thread that the Dispatcher is associated with.
        /// </summary>
        protected virtual void CancelPostPropertyChanged()
        {
            if (_invokeAction == null)
            {
                return;
            }

#if NICENIS_UWP
            _invokeAction.Cancel();
#else
            _invokeAction.Abort();
#endif
            _invokeAction = null;
        }