locked
How to tell when breadcrumb navigation has changed? RRS feed

  • Question

  • Hi,

    Is it possible to be notified in some way when the breadcrumb 'path' is changing in the workflow designer?  I thought if I used the Selection service that would effectively do what I need, but it seems there are a few cases where the breadcrumb path changes but there is no effective selection change.  For example, if the breadcrumb path is "Workflow2 > FlowChart", I can use the breadcrumb up to go to "Workflow".  No selection has changed; it's still the FlowChart activity that is selected.  Likewise, if I go from "Workflow" to "Workflow > FlowChart" by double clicking on the flow chart's designer, the selection doesn't change either.

    Thanks,
    Notre

    Tuesday, February 2, 2010 5:39 PM

Answers

  • Handling PropertyChange events for the dependency properties 'RootDesigner' on DesignerView, or the 'IsRootDesigner' on WorkflowViewElement are the main ways you might want to try.

    By memory, sapv:DesignerView is one of the services available from Context.Services

    Tim

    Friday, February 5, 2010 2:25 AM

All replies

  • Handling PropertyChange events for the dependency properties 'RootDesigner' on DesignerView, or the 'IsRootDesigner' on WorkflowViewElement are the main ways you might want to try.

    By memory, sapv:DesignerView is one of the services available from Context.Services

    Tim

    Friday, February 5, 2010 2:25 AM
  • Thanks Tim.  I'm using the RootDesigner dependency property's change notification, and that seems to work pretty well.

    Notre
    Friday, February 5, 2010 10:52 PM
  • Hi Tim,

     

    Could you provide a code example on how to handle the propertychange events for "RootDesigner"?

     

    Thanks!

     

    Li

     

    Wednesday, August 18, 2010 8:07 PM
  •         private void SubscribeToDesignerViewRootDesignerPropertyChanges()
            {
                DesignerView wdDesignerView = _workflowDesigner.Context.Services.GetService<DesignerView>();
                DependencyPropertyDescriptor rootDesignerPropertyDescriptor = DependencyPropertyDescriptor.FromProperty(DesignerView.RootDesignerProperty, DesignerView.RootDesignerProperty.OwnerType);
                rootDesignerPropertyDescriptor.AddValueChanged(wdDesignerView, RootDesignerPropertyChangedHandler);
            }

            private void UnsubscribeFromDesignerViewRootDesignerPropertyChanges()
            {
                DesignerView wdDesignerView = _workflowDesigner.Context.Services.GetService<DesignerView>();
                DependencyPropertyDescriptor rootDesignerPropertyDescriptor = DependencyPropertyDescriptor.FromProperty(DesignerView.RootDesignerProperty, DesignerView.RootDesignerProperty.OwnerType);
                rootDesignerPropertyDescriptor.RemoveValueChanged(wdDesignerView, RootDesignerPropertyChangedHandler);
            }

            private void RootDesignerPropertyChangedHandler(object sender, EventArgs e)
            {

               //Do stuff
            }

    Wednesday, August 18, 2010 11:14 PM
  • Notre,

     

    Thanks! It works!

    Friday, August 20, 2010 11:10 PM