My first gut feeling is that this is 2 progress bars joined together as a 
composite control.
I might have a hack at it for fun today if I have time.
Steven Nagy
Readify | Senior Developer
M: +61 404 044 513 | E: [email protected]<sip:[email protected]> | 
B: azure.snagy.name<http://azure.snagy.name/>

From: [email protected] [mailto:[email protected]] On 
Behalf Of Xerxes Battiwalla
Sent: Friday, 2 July 2010 8:38 AM
To: ozWPF
Subject: [How would you] Create a gauge control which fills from the middle 
outward?

Hi everyone,

This week we've needed to create a gauge control which is used to indicate 
positive values by filling a bar from the middle of the gauge upward, and 
negative values from the middle downward. A picture is worth a thousand words, 
so here's a QnD of what the control should do:
http://www.xerxesb.com/wp-content/uploads/2010/07/gauges.png

The first gauge shows the control in its initial state. When the user presses 
the up arrow, the control increases in single increments (as in the second 
gauge) and when they press down it goes in reverse (third gauge)

We managed to do it, but I wanted to canvas how everyone else would implement 
the same control?

Our implementation basically used a fill for the green bit, and placed it 
inside a grid with two rows (the grid was only half the size of the whole bar, 
and by default positioned to the entire height of the positive side of the 
gauge). The fill's size was set to take up the entire bottom row, and we then 
had some code in the code-behind to set the size of both rows using star 
values. If the value was negative we then apply a RenderTransform to flip the 
fill upside down. It works, but feels kludgy. Was hoping there is a XAML only 
way of doing something like this?

Cheers,
Xerx
_______________________________________________
ozwpf mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf

Reply via email to