Ah, OK, that makes more sense, thanks.

-----Original Message-----
From: ste...@snagy.name [mailto:ste...@snagy.name] 
Sent: Friday, 12 March 2010 12:11 p.m.
To: ozSilverlight; Mark
Cc: 'ozSilverlight'
Subject: RE: The verboseness of Visibility

No idea about this in SL but in WPF we have the same. Visibility DOES  
have 3 states: Visible, Hidden, Collapsed.

Hidden is much differen from collapsed - a hidden object will still  
take the same amount of real estate such that if you have items  
stacked and you set the first one as hidden, the second item will be  
in the same position still. However if you collapse the first item,  
the second item will move up to assume its spot. So collapsing works  
much better for flow layouts.

For people in WPF world, they're used to this tri-state and a  
BoolToVisibilityConverter is a 2 second job. (you all have a master  
resource dictionary for all these common reusable elements right?).

Perhaps the SL change is the first step towards supporting this tri-state?

Quoting Mark <markspambus...@gmail.com>:

> Yeah, I've thought about this too. I use a converter and so the View Model
> can just use a bool, but it does seem like an unnecessary step.
>
> -----Original Message-----
> From: ozsilverlight-boun...@ozsilverlight.com
> [mailto:ozsilverlight-boun...@ozsilverlight.com] On Behalf Of
> ton...@tpg.com.au
> Sent: Friday, 12 March 2010 11:31 a.m.
> To: ozsilverlight@ozsilverlight.com
> Subject: The verboseness of Visibility
>
> Hi all,
>
> Does anyone else get annoyed at the extra hastle required to set and bind
> the Visibility property?
>
> I mean, how easy was it in the "old days" to simply set IsVisible=true or
> IsVisible=false? You didn't
> need a Visibility to Bool converter, which is extra unneccessary
processing,
> and an extra point of
> failure if it's forgotten, and more text to make mistakes.
>
> I mean, come on, there are only two states. There will never be a third
> state. Instead of writing in
> my code:
>
> TermTextBox.IsVisible = MyBoolVar;
>
> I have to write something like:
> TermTextBox.Visibility = (MyBoolVar ? Visibility.Visible :
> Visibility.Collapsed);
>
> Does it somehow give it extra contextual meaning for all the extra effort?
> No.
>
> Can there be a third state, somehow semi-visible. No - that would be
handled
> via an opacity or
> animation.
>
> There is only a single meaning!
>
> It's Friday, bring it on!
>
> Regards,
> Tony

_______________________________________________
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight

Reply via email to