Home » Visual Studio

Make FlowChart designer fill workflow designer area



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).




6 Answers Found


Answer 1

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.


Answer 2

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).




Answer 3

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"

Answer 4

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.




Answer 5

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.


Answer 6

Just to be clear I did get it working, using the approach I described above.

Thanks for the help.




<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure