Question : Expression Blend - Bind Visibility to item in Combo Box.

Using Expression Blend Sketch Flow I have a screen with a combo box that has "yes" and "no" as items.  If "yes" is selected, I need the Visibility of anothe combo box to be "Visible".  If "no", then it should be "Collapsed".  

How would I do this?

Answer : Expression Blend - Bind Visibility to item in Combo Box.

There are several options (All of them requires some kind of code in C#):
1) Have the visibility of the second combobox binded to the SelectedItem of the first combobox and use a converted to convert the Yes No string to visibility

2) Have the combobox contain items from list (Binding to list) and the items will be enums. It is better practive to convert enums to visibility than convert string to visibility (since your program might sopport localization in the future and the text of Yes/No might be different (other language) while enum doesn't change.

3) have the combobox contain items from list (binding) and the items will be classes. The classes will contain a property of type Visibility and their ToString will return Yes or No
Random Solutions  
 
programming4us programming4us