Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Drawing scales and aligned objects

 
 
Old 07-13-2006   #1 (permalink)
=?Utf-8?B?Q2hyaXMgQ29vaw==?=


 
 

Drawing scales and aligned objects

I have been trying to create a graphical control for WinFX that will have a
calibrated backdrop of time of day across the top and a list of data driven
objects that align their visual component at the appropriate start and end
time on the back drop..

So far I’ve taken 2 shots at this.. The First one uses a set of
IMultiConvert objects and calculates the height and width of things given a
top level object that is bound in for total width and a percentage factor for
how much of that goes into this or that object . It works but the XAML gets
pretty icky and, in the end, the rounding error makes stuff be a bit off of
alignment as you stretch and shrink the window the control is in.

The second approach is somewhat cleaner... I draw the control as a grid
of 96 columns ( 15 minute intervals for a day ) and then draw stuff in that
grid assigning Gid.Column and Grid.ColumnSpan to everything. That works fine
until I try to draw in the data… The ListBox will take positioning from the
Grid but none of the DataTemplates displaying the data care what Grid Column
I set.

So… How to proceed is my question… I figure there is an option 3 somewhere
that makes this all trivial and I’m just too old school to see it. Perhaps
number 2 can be made to work but I’ve beat on styles and XAML for a day now
and can’t seem to find it.

Can someone help me???


My System SpecsSystem Spec
Old 07-14-2006   #2 (permalink)
=?Utf-8?B?dmlsaWVzY3U=?=


 
 

RE: Drawing scales and aligned objects

Regarding the second approach - if you want to position DataTemplates in a
container you should read this:
http://www.i-constructions.com/myblo...tabinding.html

--
Valentin Iliescu [MVP - Client Application Development]


"Chris Cook" wrote:

> I have been trying to create a graphical control for WinFX that will have a
> calibrated backdrop of time of day across the top and a list of data driven
> objects that align their visual component at the appropriate start and end
> time on the back drop..
>
> So far I’ve taken 2 shots at this.. The First one uses a set of
> IMultiConvert objects and calculates the height and width of things given a
> top level object that is bound in for total width and a percentage factor for
> how much of that goes into this or that object . It works but the XAML gets
> pretty icky and, in the end, the rounding error makes stuff be a bit off of
> alignment as you stretch and shrink the window the control is in.
>
> The second approach is somewhat cleaner... I draw the control as a grid
> of 96 columns ( 15 minute intervals for a day ) and then draw stuff in that
> grid assigning Gid.Column and Grid.ColumnSpan to everything. That works fine
> until I try to draw in the data… The ListBox will take positioning from the
> Grid but none of the DataTemplates displaying the data care what Grid Column
> I set.
>
> So… How to proceed is my question… I figure there is an option 3 somewhere
> that makes this all trivial and I’m just too old school to see it. Perhaps
> number 2 can be made to work but I’ve beat on styles and XAML for a day now
> and can’t seem to find it.
>
> Can someone help me???
>

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
How to write a formatted number left-padded right-aligned into a 6-char-wide-column? VB Script
Mouse pointer not aligned Vista General
paintshop drawing etc Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46