Seriously, it seems like every time I want to make my UI elements talk to each other, I end up coding a new, custom, IValueConverter :(. Someone tell me that I'm doing it wrong, please!
Examples:
- I wanted a button to be enabled only if my textbox contained a valid URI. Great, time to code up a
UriIsValidConverter
! - Oh oops, I also wanted to disable it while I'm processing something. I guess now I need to code up a
UriIsValidAndBoolIsFalseMultiConverter
! - I want to display a list of files in a certain directory (specified by a textbox) inside a listbox. I guess I need a
DirectoryPathToFileList
converter! - Oh hey, I want icons for each of those files in the listview. Time for a
FileInfoToBitmap
converter! - I want my status to be red if my status-string contains "Error", and green otherwise. Yay, I get to code up a
StatusStringToSolidColorBrushConverter
!
I'm really thinking this isn't that much better than the old Windows Forms method of just wiring up everything manually using TextChanged
events (or whatever). Which I guess is still an option. Is that what people actually do, perhaps, and I'm trying too hard to make everything fit into the databinding paradigm?
So yeah, please tell me if this is really how WPF coding is---or if I'm doing it wrong, and if so, what I should be doing.