Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WPF Binding
Message
From
28/10/2009 13:35:28
 
 
To
28/10/2009 13:16:15
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Title:
Miscellaneous
Thread ID:
01431906
Message ID:
01431950
Views:
34
>Thanks for the link Bonnie. I, like you, am only just delving into this stuff. I thought that a ValueConverter was going to be required but I had the impression that it was done in the code behind. Looks like I have a lot to learn.

The ValueConverter can be defined anywhere in your app (or in any assembly it references). Where these are fairly generic I tend to put them in a standard library. You can then specify this converter in the XAML binding.
HTH,
Viv
>
>
>>Mike,
>>
>>I am certainly no expert and just barely learning this stuff myself, but I remember reading something about using ValueConverters for this sort of thing.
>>
>>The only link I have is about using IMultiValueConverter in Silverlight (I needed to research this because I was playing around with moving a WPF demo app I downloaded from somewhere to try and make it a Silverlight app, and ran into the issue that Silverlight didn't support MultiValueConverters).
>>
>>But, anyway, it was an interesting read: http://groups.google.com/group/wpf-disciples/browse_thread/thread/2c31f951378ca336 ... I don't know if it helps you any though.
>>
>>~~Bonnie
>>
>>
>>
>>>I'm trying to toggle the visibility of a grid layout column. I've set the width to "Auto" and placed a control (listbox) inside the column with Visibility = Visible. In another grid column, I have a checkbox with IsChecked=False. I'd like to toggle the visibility of the first grid column based on the checked status of the checkbox.
>>>
>>>I think that if I can set the listbox's Visibility based on the checkbox, the grid column would fix itself since its width is "Auto". I also figured that I should be able to use Binding to set the listbox's Visibility (based on the checkbox's IsChecked property). I've tried placing the following in the listbox's XAML:
>>>
>>>
>>><ListBox ... Visibility="{Binding ElementName=cbHideIO, Path=isChecked}" />
>>>
>>>
>>>where the checkbox's name is cbHideIO, but, that does not work. Nothing happens when I check / uncheck the checkbox. I know this issue has to do with the fact that isChecked is "True" or "False" and that the Visibility property of the ListBox needs to be "Visible" or "Collapsed". The question is, how do I "convert" the types in pure XAML and not require any code behind (if that's possible).
>>>
>>>TIA,
>>>Mike
Previous
Reply
Map
View

Click here to load this message in the networking platform