none
How to scroll the WorkflowDesigner RRS feed

  • Question

  • I have workflow in the Rehosted WorkflowDesigner.

    I select the activity using

    Selection.Select(WorkflowDesigner.Context, modelItem);

    But, if activity is not visible in the visible area WorkflowDesigner doesn't scroll to show it.

    How to scroll the WorkflowDesigner to show the selected activity?


    Regards,
    Jaydeep

    Thursday, November 8, 2012 6:23 AM

Answers

  •  if (CurrentActivity.DisplayName==SelMsg)
     {
       ModelItemExtensions.Focus(ModelItemActivity);
     }

    The above code helps to focus to focus to the model item.

    But if the selection has mutilple model items ModelItemExtensions will focus the last focus set value by

    ModelItemExtensions.Focus(ModelItemActivity).

    i was looking for setting that scroll to the activity with mutiple selected activities.

      Selection.Union(WorkflowDesigner.Context, activity);

    Thanks,


    Monday, November 12, 2012 11:54 AM

All replies

  •  if (CurrentActivity.DisplayName==SelMsg)
     {
       ModelItemExtensions.Focus(ModelItemActivity);
     }

    The above code helps to focus to focus to the model item.

    But if the selection has mutilple model items ModelItemExtensions will focus the last focus set value by

    ModelItemExtensions.Focus(ModelItemActivity).

    i was looking for setting that scroll to the activity with mutiple selected activities.

      Selection.Union(WorkflowDesigner.Context, activity);

    Thanks,


    Monday, November 12, 2012 11:54 AM
  • Thanks for the answer.

    However, it works only if I have written the below code 

    (File: WorkflowDesignerHost.xaml.cs Method: UpdateSourceLocationMappingInDebuggerService)

    SourceLocationProvider.CollectMapping(GetRootRuntimeWorkflowElement(), documentRootElement, sourceLocationMapping,                     this.WorkflowDesigner.Context.Items.GetValue<WorkflowFileItem>().LoadedFile);

    SourceLocationProvider.CollectMapping(documentRootElement, documentRootElement, designerSourceLocationMapping,                    this.WorkflowDesigner.Context.Items.GetValue<WorkflowFileItem>().LoadedFile);

    (Code from: http://msdn.microsoft.com/en-us/library/ee624139.aspx)

    Is this code required or am I missing something else?


    Regards,
    Jaydeep





    Monday, November 19, 2012 1:42 PM
  • Hi Jaydeep,

    In my application the selection and scrolling works without the debugger  code.

    I have just looped thru the model item from model services  and set the focus to each model item required using ModelItemExtensions.

     modelService.Find(modelService.Root, typeof(Activity));
     ModelItemExtensionsFocus(Modelitem)

    Thanks

    Monday, November 19, 2012 1:54 PM