Click here to Skip to main content
16,015,351 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: DATAGRID - WPF c# 2010 Pin
Pete O'Hanlon25-Apr-11 23:36
mvePete O'Hanlon25-Apr-11 23:36 
GeneralRe: DATAGRID - WPF c# 2010 Pin
arkiboys26-Apr-11 0:08
arkiboys26-Apr-11 0:08 
GeneralRe: DATAGRID - WPF c# 2010 Pin
Pete O'Hanlon26-Apr-11 0:31
mvePete O'Hanlon26-Apr-11 0:31 
QuestionNewbie problem: laying out grid issues in silverlight Pin
Lee Reid25-Apr-11 1:31
Lee Reid25-Apr-11 1:31 
AnswerRe: Newbie problem: laying out grid issues in silverlight Pin
Pete O'Hanlon25-Apr-11 4:15
mvePete O'Hanlon25-Apr-11 4:15 
AnswerRe: Newbie problem: laying out grid issues in silverlight Pin
SledgeHammer0125-Apr-11 6:33
SledgeHammer0125-Apr-11 6:33 
GeneralRe: Newbie problem: laying out grid issues in silverlight Pin
Lee Reid25-Apr-11 14:14
Lee Reid25-Apr-11 14:14 
GeneralRe: Newbie problem: laying out grid issues in silverlight Pin
SledgeHammer0125-Apr-11 14:45
SledgeHammer0125-Apr-11 14:45 
First off, let me correct you on one thing that will open up your world Smile | :) ... there is no rule that says you can't have multiple containers in one window on top of each other. I.e. a window doesn't necessarily have to be:

<Window>
<ViewBox />
</Window>

it could also be:

<Window>
<Grid>
<ViewBox />
<Grid />
</Grid>
</Window>

Not saying the 2nd option is always a good idea because it could be very difficult if not impossible to sync up the two containers if they are different depending on your content.

Anyways, in regards to the bicycle wheel, I used that example because I actually had to do a control kind of similiar to that. I wanted to scale the size of the two circles and the *length* of the spokes, but I wanted the stroke thickness of the two circles and the spokes to remain consistent at one pixel.

I did in fact end up using a ViewBox for that, but to keep the lines a consistent stroke thickness, I defined a DependencyProperty of type double that was updated with the inverse scaling ratio as the control was resized and bound it to everything I wanted to keep consistent.

So the original stroke thickness was defined as 1.0, and if the user scaled to 2x the original size for example, the stroke thickness would be updated to 0.5 to keep the lines at 1 pixel thickness. If they scaled to 50%, the stroke thickness would be updated to 2.0.

You really have to play with your particular content to see how it scales in the ViewBox by default. Its sometimes kind of wacky and you have to do wacky stuff to compensate.
GeneralRe: Newbie problem: laying out grid issues in silverlight Pin
Lee Reid25-Apr-11 16:02
Lee Reid25-Apr-11 16:02 
QuestionAny trick for *REUSABLE* "Application" class? Pin
SledgeHammer0121-Apr-11 8:32
SledgeHammer0121-Apr-11 8:32 
AnswerRe: Any trick for *REUSABLE* "Application" class? Pin
Ian Shlasko21-Apr-11 8:46
Ian Shlasko21-Apr-11 8:46 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
SledgeHammer0121-Apr-11 8:48
SledgeHammer0121-Apr-11 8:48 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
Ian Shlasko21-Apr-11 8:48
Ian Shlasko21-Apr-11 8:48 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
SledgeHammer0121-Apr-11 8:59
SledgeHammer0121-Apr-11 8:59 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
Ian Shlasko21-Apr-11 9:10
Ian Shlasko21-Apr-11 9:10 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
SledgeHammer0121-Apr-11 9:33
SledgeHammer0121-Apr-11 9:33 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
Ian Shlasko21-Apr-11 10:00
Ian Shlasko21-Apr-11 10:00 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
SledgeHammer0121-Apr-11 11:29
SledgeHammer0121-Apr-11 11:29 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
Ian Shlasko21-Apr-11 15:27
Ian Shlasko21-Apr-11 15:27 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
SledgeHammer0121-Apr-11 17:06
SledgeHammer0121-Apr-11 17:06 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
Ian Shlasko21-Apr-11 17:22
Ian Shlasko21-Apr-11 17:22 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
Pete O'Hanlon22-Apr-11 9:25
mvePete O'Hanlon22-Apr-11 9:25 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
SledgeHammer0122-Apr-11 9:52
SledgeHammer0122-Apr-11 9:52 
GeneralRe: Any trick for *REUSABLE* "Application" class? Pin
Pete O'Hanlon22-Apr-11 9:56
mvePete O'Hanlon22-Apr-11 9:56 
QuestionHmm ...MVVM ... Is this Bad? I can't decide Pin
Jammer21-Apr-11 4:26
Jammer21-Apr-11 4:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.