/// <summary> /// Ensures that all items being hosted by this panel are properly realized or virtualized. /// </summary> public void UpdateReality() { RealizeOperation.Abort(); RealizeOperation = null; object state = null; do { state = RealizeCore(state); }while (state != null); }
/// <summary> /// Invalidates the realization state of all items being hosted by this panel. After the invalidation, the panel will have its reality updated, which will occur asynchronously unless subsequently forced by <see cref="UpdateReality"/>. /// </summary> public void InvalidateReality() { if (RealizeOperation != null) { RealizeOperation.Abort(); } object state = null; Action action = null; action = delegate { RealizeOperation = null; state = RealizeCore(state); if (state != null && RealizeOperation == null) { RealizeOperation = Dispatcher.BeginInvoke(action, RealizationPriority); } }; RealizeOperation = Dispatcher.BeginInvoke(action, RealizationPriority); }