Change Design Surface Background Color  
Author Message
Mark Doughty





PostPosted: Windows Workflow Foundation, Change Design Surface Background Color Top

I'm embedding a workflow designer inside of my application. I based this off of the Designer ReHosting sample. It is working just fine.

However, I absolutely despise the blue'ish designer surface that my workflow appears on top of by default. Is there a way to change this design surface color Sounds like a very trivial problem, but I've yet to figure out how...

Thanks,

Mark



Software Development for Windows Vista15  
 
 
Matt Milner - Pluralsight





PostPosted: Windows Workflow Foundation, Change Design Surface Background Color Top

Have you tried creating a custom theme and applying it to the designer

Matt



 
 
Mark Doughty





PostPosted: Windows Workflow Foundation, Change Design Surface Background Color Top

I have been trying to mess with the themes, but I still have been unable to change the color of the design surface.

I have been able to change the background color of a specific activity quite easily. I'm not interested in this however. I'm just interested in changing the color of the design surface.

But perhaps I'm misunderstanding you and what you are suggesting. Can you be more specific or do you have any other ideas

Thanks,

Mark


 
 
Matt Milner - Pluralsight





PostPosted: Windows Workflow Foundation, Change Design Surface Background Color Top

If I understand what you are trying to do, then I think you can do the following:

Get a copy of the current theme (myTheme = WorkflowTheme.CurrentTheme.Clone)

change the properties of the AmbientTheme to what you want (background etc)

Set the current them with your theme (WorkflowTheme.CurrentTheme = myTheme)

HTH,

Matt



 
 
Mark Doughty





PostPosted: Windows Workflow Foundation, Change Design Surface Background Color Top

Again, I should have been even more specific. I can change all the other properties of the AmbientTheme, but not the background color.

For instance using your example, I could do:

myTheme.AmbientTheme.BackColor = Color.Purple;

And there will be no change to purple. However, doing something else like:

myTheme.AmbientTheme.DrawGrayscale = true;

Will actually make everything grayscale. Similarly, instead doing something like:

myTheme.AmbientTheme.SelectionColor = Color.Purple;

Will make the selection purple.

This is very frustrating to me. It seems like perhaps something besides BackColor is what I'm looking for, but if so, I don't know what it would be. I've set every available color property to Purple with no luck changing the background surface area around the contained activities.

Thanks for your help.

Mark


 
 
_vihang





PostPosted: Windows Workflow Foundation, Change Design Surface Background Color Top

Mark,

were you able to get through this problem

Thanks!



 
 
Dennis Pilarinos MSFT





PostPosted: Windows Workflow Foundation, Change Design Surface Background Color Top

Mark,

Sorry to hear about your frustrations.

I *think* I know what you're trying to do, but I'm a bit confused between two colors you might be wanting to change.

If you're trying to change the color that "appears on top of the workflow by default", I think you want to change the title color surrounding "Sequential Workflow". You can do this as part of the theming support in WF. Create a new theme, choose "Sequential Workflow" and change the Border Color there.

However, if you're looking to change "the background surface area around the contained activities", you'll need to write your own designer (perhaps derive from SequentialWorkflowRootDesigner) and override the OnPaint() to set your color.

Hope this helps,

Dennis



 
 
Mark Doughty





PostPosted: Windows Workflow Foundation, Change Design Surface Background Color Top

Actually I'm looking a bit "larger" than the root activity.   After much experimentation, I'm pretty sure it is actually the WorkflowView display functionality that I want to change.

I've already written my own designer, and I can override OnPaint in my root designer to do this:

e.Graphics.FillRectangle(new SolidBrush(Color.Magenta), e.ClipRectangle);

Which gives me a big purple blob.

This blob is "on top of" a white piece of paper with a blue border around that paper and then lastly the blueish/grayish background color around that piece of paper.   Hopefully this is a good explanation.   If not, I can post a screenshot of this someplace.

Ideally, I'd like to just make the WorkflowView have an entirely white background.   The effect that it has now in my application is a little weird.   I dock the WorkflowView as Dock.Fill so it is the main focus of the application.     However, the end result is a root designer with a border around it, and then a white space, and the blue border around that, and then the grayish/blueish background, and then 1 last border around that (that I added) so that it doesn't look terrible blending into my form.

If I derive from WorkflowView and override its OnPaint, I get all that other stuff to go away and I'm just left with 1 gigantic purple blob.  Yay!   So something inside of WorkflowView I need to change or override or something.

Any ideas    And thanks in advance for any help.  :)

Mark

 


 
 
Denis R - MSFT





PostPosted: Windows Workflow Foundation, Change Design Surface Background Color Top

Hi Mark,

In the sample code (http://download.microsoft.com/download/c/3/2/c325e3b1-9b85-407c-8c4b-422a5cf04126/workflowdesignercontrol.exe) I was able to change the background color of the design surface by changing line 60 in WorkflowDesingerControl.cs to a color of my choice.

If this is not the desired effect, could you post a screenshot to help me understand better

Thanks!

Denis