If, on a WPF window, you have more than 1 {Binding} for a parameter, is it possible to name them ?
For example for images i have (in the XAML part): Visibility="{Binding}" but also on some textboxes i want to make IsEnabled="{Binding}"
Is there some way to name them ? So that in the code in the backside (.cs side) it will pick the right one ?
Thanx in advance.
You can simply have view model wrapping those properties into single object:
Note that you’ll also need a boolean to visibility converter, which examples of you can find on StackOverflow (here)… or elsewhere.
Then, you simply set instance of
ViewModelto your form data context:You can then do images binding like
Visibility="{Binding ImagesVisibility}"and textboxIsEnabled="{Binding IsTextBoxEnabled}".