Click here to Skip to main content
15,916,379 members
Home / Discussions / WPF
   

WPF

 
QuestionSilverlight listbox selected item template Pin
USAFHokie806-Feb-12 6:49
USAFHokie806-Feb-12 6:49 
AnswerRe: Silverlight listbox selected item template Pin
SledgeHammer016-Feb-12 10:50
SledgeHammer016-Feb-12 10:50 
AnswerRe: Silverlight listbox selected item template Pin
Abhinav S6-Feb-12 16:29
Abhinav S6-Feb-12 16:29 
Questionhierachical menu Pin
arkiboys6-Feb-12 4:26
arkiboys6-Feb-12 4:26 
AnswerRe: hierachical menu Pin
Abhinav S6-Feb-12 4:40
Abhinav S6-Feb-12 4:40 
GeneralRe: hierachical menu Pin
arkiboys6-Feb-12 5:36
arkiboys6-Feb-12 5:36 
AnswerRe: hierachical menu Pin
Abhinav S6-Feb-12 5:55
Abhinav S6-Feb-12 5:55 
GeneralRe: hierachical menu Pin
arkiboys6-Feb-12 22:37
arkiboys6-Feb-12 22:37 
QuestionPlay DVD Pin
Alessio Elia6-Feb-12 3:52
Alessio Elia6-Feb-12 3:52 
AnswerRe: Play DVD Pin
Alisaunder10-Feb-12 1:10
Alisaunder10-Feb-12 1:10 
QuestionConditional DataBinding to UI Elements Pin
Andy_L_J4-Feb-12 12:40
Andy_L_J4-Feb-12 12:40 
AnswerRe: Conditional DataBinding to UI Elements Pin
SledgeHammer014-Feb-12 13:39
SledgeHammer014-Feb-12 13:39 
GeneralRe: Conditional DataBinding to UI Elements Pin
Andy_L_J4-Feb-12 15:18
Andy_L_J4-Feb-12 15:18 
GeneralRe: Conditional DataBinding to UI Elements Pin
SledgeHammer014-Feb-12 15:54
SledgeHammer014-Feb-12 15:54 
GeneralRe: Conditional DataBinding to UI Elements Pin
Andy_L_J4-Feb-12 17:42
Andy_L_J4-Feb-12 17:42 
AnswerRe: Conditional DataBinding to UI Elements Pin
Mycroft Holmes4-Feb-12 17:00
professionalMycroft Holmes4-Feb-12 17:00 
GeneralRe: Conditional DataBinding to UI Elements Pin
Andy_L_J4-Feb-12 17:48
Andy_L_J4-Feb-12 17:48 
GeneralRe: Conditional DataBinding to UI Elements Pin
Mycroft Holmes4-Feb-12 21:04
professionalMycroft Holmes4-Feb-12 21:04 
GeneralRe: Conditional DataBinding to UI Elements Pin
Andy_L_J4-Feb-12 22:05
Andy_L_J4-Feb-12 22:05 
GeneralRe: Conditional DataBinding to UI Elements Pin
Mycroft Holmes5-Feb-12 0:58
professionalMycroft Holmes5-Feb-12 0:58 
GeneralRe: Conditional DataBinding to UI Elements Pin
SledgeHammer015-Feb-12 7:53
SledgeHammer015-Feb-12 7:53 
Mycroft Holmes wrote:
I often create a bunch bool(s) in the VM to manage the state of the view based
on the data content.


Which is often extremely silly, unnecessary, unmaintainable and not the right way to go.

1) If you write a generic converter, you can often re-use it, not only for multiple properties, but multiple views.

By generic converter, no, I don't mean one that converts empty strings to "(Empty)" and another one that converts falses to "Off" for example. I mean, one that say could convert any object & value to any other object & value.

A few EXCELLENT examples of true GENERIC converters: a map converter and a math converter

Too often I see BoolToVisibilityConverter and InverseBoolToVisibilityConverter, etc. when you could have done both and then some with the generic MapConverter.

2) Other then the generic converters, the other option is of course triggers. I'm betting I could re-write 90% of your bool view state properties as one line triggers.
GeneralRe: Conditional DataBinding to UI Elements Pin
Mycroft Holmes5-Feb-12 11:01
professionalMycroft Holmes5-Feb-12 11:01 
GeneralRe: Conditional DataBinding to UI Elements Pin
SledgeHammer015-Feb-12 11:49
SledgeHammer015-Feb-12 11:49 
GeneralRe: Conditional DataBinding to UI Elements Pin
Mycroft Holmes5-Feb-12 12:15
professionalMycroft Holmes5-Feb-12 12:15 
GeneralRe: Conditional DataBinding to UI Elements Pin
SledgeHammer015-Feb-12 12:26
SledgeHammer015-Feb-12 12: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.