So, you have your first XAML page up. Well done.
Let’s say your manager comes over and says that now when a user uses the app, if they are Canadian the app should show that they now get free Moose Butter.
Let’s have a look at one way we can skin this Moose. On a high level, your Model could have a new property that you could bind to the Page, perhaps a Label like this:
But that is not very re-usable. Instead we can simply ask the Model if the user is a Canadian and if so, show that text.
First we need a converter which will understand “Canada” as a country and the text to show.
It has two simple functions. We’ll just concentrate on the conversion of text “Convert”, not back and forth with “ConvertBack” It’s one way.
Now let’s add it to our form so that a Label can use it:
Then we can consume it: