locked
Make FlowChart designer fill workflow designer area RRS feed

  • Question

  • Hi,

     

    Is there a way to make an (expanded) FlowChart activity's designer fill the entire workflow designer area (excluding the areas used by expand/collapse links, breadcrumb, workflow shellbar, etc)? 

    Depending on the size of the area in which the workflow designer is hosted, there can be a lot of wasted 'white space' around the FlowChart that can't be used for anything by the workflow author.  While the workflow author can resize the FlowChart designer within the workflow designer, it would be nice to have a way to make the workflow designer automically size to fill, at least to the initial size, of the available designer area.  (It might not be great to have this continously resize the FlowChart designer automatically, but at least if it initially fills the free space, that would be nice).

    Thanks,

    Notre

    Friday, July 2, 2010 8:39 PM

Answers

  • Hi Ye,

    Modifying the flowchart view state did the trick. I didn't find any Shape key that was is use, but there are Width and Height keys, and when I set the view state based on these keys, I was able to adjust the flowchart size to my satisfaction. 

    The one other challenge was figuring out what size to set my flowchart to; I wanted to fill the available space.  Unfortunately, there was no API to figure out the available size.  I ended up starting with the DesignerView and then walking down the visual tree until I found the ScrollViewer whose parent was a grid named designerViewGrid, and then using the PART_ScrollContentPresenter part as the basis of the viewable area.  This seems to get the job done, but isn't the greatest solution as I fear it will break when MS updates the designer code.

    Thanks,

    Notre

    • Marked as answer by Notre Tuesday, July 6, 2010 9:21 PM
    Tuesday, July 6, 2010 6:48 PM

All replies

  • Notre, I guess you are talking about the root flowchart.

    if resizing the expanded flowchart can't meet your request, I don't think there is any other solution.

    Monday, July 5, 2010 1:06 AM
  • Hi Ye Yu,

    Yeah, I'd like to resize the expanded flowchart, when the flowchart is initially displayed such that its size fits the available space. It would be the same as the user resizing the flowchart manually, but I'd like to programmatically set the size (to fill the initially available space).

    Thanks,

    Notre

    Monday, July 5, 2010 3:45 PM
  • if so, you may monitor modelchange event, when you catch the flowchart you want to resize, you can change the flowchart viewstate information, the key is "Shape"
    Tuesday, July 6, 2010 2:10 AM
  • Hi Ye,

    Modifying the flowchart view state did the trick. I didn't find any Shape key that was is use, but there are Width and Height keys, and when I set the view state based on these keys, I was able to adjust the flowchart size to my satisfaction. 

    The one other challenge was figuring out what size to set my flowchart to; I wanted to fill the available space.  Unfortunately, there was no API to figure out the available size.  I ended up starting with the DesignerView and then walking down the visual tree until I found the ScrollViewer whose parent was a grid named designerViewGrid, and then using the PART_ScrollContentPresenter part as the basis of the viewable area.  This seems to get the job done, but isn't the greatest solution as I fear it will break when MS updates the designer code.

    Thanks,

    Notre

    • Marked as answer by Notre Tuesday, July 6, 2010 9:21 PM
    Tuesday, July 6, 2010 6:48 PM
  • I think the visualtreeHelper is the only thing which can help you.

    the wideth and height are not public properties.

    maybe you can take a look at designerView.xaml and get some hint.

    Tuesday, July 6, 2010 7:40 PM
  • Just to be clear I did get it working, using the approach I described above.

    Thanks for the help.

    Notre

    Tuesday, July 6, 2010 9:21 PM