protected override void OnModelPropertyChanged(string propertyName)
        {
            if (propertyName == "Presentation")
            {
                if (myPresentation == Model.Presentation)
                {
                    return;
                }

                if (myPresentation != null)
                {
                    myPresentation.GetModule <INodeMaskModule>().CollectionChanged -= OnMasksChanged;
                    myPresentation.GraphVisibilityChanged -= OnGraphVisibilityChanged;
                }

                myPresentation = Model.Presentation;

                Filter = null;

                if (myPresentation != null)
                {
                    myPresentation.GetModule <INodeMaskModule>().CollectionChanged += OnMasksChanged;
                    myPresentation.GraphVisibilityChanged += OnGraphVisibilityChanged;

                    OnGraphVisibilityChanged(null, EventArgs.Empty);
                }

                myPreviewNodes = null;
                PreviewNodes.Refresh();
            }
        }
Example #2
0
        protected override void OnModelPropertyChanged(string propertyName)
        {
            if (propertyName == "Presentation")
            {
                if (myPresentation == Model.Presentation)
                {
                    return;
                }

                if (myTransformationsObserver != null)
                {
                    myTransformationsObserver.ModuleChanged -= OnTransformationsChanged;
                    myTransformationsObserver.Dispose();
                }

                myPresentation = Model.Presentation;

                // first build tree - master for preview
                BuildTree();

                // rebuild preview
                myPreviewNodes = null;
                if (Filter == null)
                {
                    PreviewNodes.Refresh();
                }
                else
                {
                    Filter = null;
                }

                // register for updates only AFTER tree is built up completely to avoid getting notified by the built up process
                var transformationModule = Model.Presentation.GetModule <ITransformationModule>();
                myTransformationsObserver = transformationModule.CreateObserver();
                myTransformationsObserver.ModuleChanged += OnTransformationsChanged;
            }
        }
 private void OnMasksChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     PreviewNodes.Refresh();
 }
Example #4
0
 private void OnTransformationsChanged(object sender, EventArgs e)
 {
     BuildTree();
     PreviewNodes.Refresh();
 }