Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Drawing scales and aligned objects

Closed Thread
 
Thread Tools Display Modes
Old 07-13-2006   #1 (permalink)
=?Utf-8?B?Q2hyaXMgQ29vaw==?=
Guest


 

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???

Old 07-14-2006   #2 (permalink)
=?Utf-8?B?dmlsaWVzY3U=?=
Guest


 

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???
>

Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Canvas does not allow drawing PhredBear Vista General 2 3 Weeks Ago 02:07 PM
Mouse pointer not aligned denmarfl Vista General 24 07-14-2008 12:43 PM
Dynamically Drawing Objects kmttern Avalon 0 03-25-2008 09:51 AM
paintshop drawing etc Mudnox Vista General 0 10-30-2007 07:17 AM
WPF Custom Drawing Weston Weems Avalon 3 08-24-2006 11:42 AM








Vistax64.com 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 2005-2008

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 47 48 49 50