Exemplo n.º 1
0
        /// <summary>
        /// Child classes can override this method to perform
        /// clean-up logic, such as removing event handlers.
        /// </summary>
        protected virtual void OnDispose()
        {
            if (_designerManagementService != null)
            {
                _designerManagementService.CollapseAllRequested -= OnDesignerManagementServiceCollapseAllRequested;
                _designerManagementService.ExpandAllRequested   -= OnDesignerManagementServiceExpandAllRequested;
                _designerManagementService.RestoreAllRequested  -= OnDesignerManagementServiceRestoreAllRequested;
            }
            if (_showCollapseLargeView != null)
            {
                _showCollapseLargeView.Click -= ShowCollapseFromContextMenu;
            }
            if (Context != null)
            {
                Context.Items.Unsubscribe <Selection>(OnSelectionChanged);
                Context.Services.Unsubscribe <IDesignerManagementService>(OnDesignerManagementServiceChanged);
            }

            if (_zIndexProperty != null)
            {
                _zIndexProperty.RemoveValueChanged(_dataContext, OnZIndexPositionChanged);
            }
            if (ViewModel != null)
            {
                ViewModel.Dispose();
            }

            Loaded -= OnRoutedEventHandler;

            Unloaded -= ActivityDesignerUnloaded;
            CEventHelper.RemoveAllEventHandlers(this);
            CEventHelper.RemoveAllEventHandlers(this);
            GC.SuppressFinalize(this);
        }
Exemplo n.º 2
0
 protected override void OnDispose()
 {
     base.OnDispose();
     CEventHelper.RemoveAllEventHandlers(TheGrid);
     CEventHelper.RemoveAllEventHandlers(this);
     CEventHelper.RemoveAllEventHandlers(ModelItem);
     _dataContext.ModelItemCollection.CollectionChanged -= ModelItemCollectionCollectionChanged;
 }
Exemplo n.º 3
0
        public void Dispose()
        {
            TitleBarToggles.Clear();

            _modelItem.PropertyChanged -= OnModelItemPropertyChanged;

            OnDispose();
            CEventHelper.RemoveAllEventHandlers(this);
            CEventHelper.RemoveAllEventHandlers(TitleBarToggles);
            CEventHelper.RemoveAllEventHandlers(ModelItem);
            GC.SuppressFinalize(this);
        }
 protected override void OnDispose()
 {
     ProcessModelItemCollection(0, mi =>
     {
         var dto = mi.GetCurrentValue() as TDev2TOFn;
         if (dto != null)
         {
             CEventHelper.RemoveAllEventHandlers(dto);
         }
         CEventHelper.RemoveAllEventHandlers(mi);
     });
     base.OnDispose();
 }
Exemplo n.º 5
0
 protected override void OnDispose()
 {
     ProcessModelItemCollection(0, mi =>
     {
         if (mi.GetCurrentValue() is TDev2TOFn dto)
         {
             CEventHelper.RemoveAllEventHandlers(dto);
         }
         CEventHelper.RemoveAllEventHandlers(mi);
     });
     if (ModelItemCollection != null)
     {
         BindingOperations.DisableCollectionSynchronization(ModelItemCollection);
     }
     ModelItemCollection = null;
     base.OnDispose();
 }
Exemplo n.º 6
0
 protected override void OnDispose()
 {
     CEventHelper.RemoveAllEventHandlers(ModelItemCollection);
     CEventHelper.RemoveAllEventHandlers(QuickVariableInputViewModel);
     CEventHelper.RemoveAllEventHandlers(ModelItem);
 }