Exemple #1
0
 /// <summary>
 /// Creates an instance with no <see cref="Parent"/>.
 /// </summary>
 public ViewObject()
 {
     _parent = null !;
     _parentChangeEventCache = null !;
     _children = new ObservableCollection <IViewObject>();
     _children.CollectionChanged += OnChildrenChanged;
 }
Exemple #2
0
        /// <summary>
        /// Fires any cached events when events are resumed.
        /// </summary>
        protected override void OnEventsResumed()
        {
            lock (SyncRoot)
            {
                // Fire any cached base class events
                base.OnEventsResumed();

                // Do nothing more when no events are cached for this class
                if (_parentChangeEventCache == null)
                {
                    return;
                }

                // Clear cache
                var args = _parentChangeEventCache;
                _parentChangeEventCache = null !;

                // Fire event
                ParentChanged?.Invoke(this, args);
            }
        }