I am trying to save another user's code right now when this person is a WPF expert. I, on the other hand, no. :)
The code uses IValueConverter to convert an enumeration of states to a boolean that determines whether the UserControl is displayed on the screen.
I found a drawback that just listing in this circumstance is not enough, in fact there is another logical value that also needs to be taken into account. Is there any other object that could be used to take 2 elements as arguments to convert? (The converter option is already in use.)
Quick example:
The logic of the existing code says ...
If it sunny, go to work. If it raining, don't go to work.
I need to consider one more thing that would do it as follows.
If it sunny and you're wearing pants, go to work. If it sunny and you're not wearing pants, don't go to work. If it raining and you're wearing pants, don't go to work. If it raining and you're not wearing pants, don't go to work.
The IValueConverter that will perform the conversion allows me to take one βthingβ for the conversion.
Any help is appreciated. Thanks,
Mj
source share