Let’s say we want to display a list of countries, and depending on the user input we want to show either the capital city, population, or the language spoken in the country alongside the country name, like in the application below:
The only way to achieve that is to change binding in code. You cannot have something like
<Binding Path="{Binding SelectedField}" />
because Path
is not a dependency property. 🙁