December 2019
Intermediate to advanced
528 pages
11h 19m
English
Now that we've created our frontend XAML file, let's have a look at the code-behind (MainPage.xaml.cs):
public sealed partial class MainPage : Page { public MainPage() { this.InitializeComponent(); DataContext = new MainViewModel(); } }
As you can see, there is very little to discuss here. In fact, we actually have only one additional line of code, which sets the DataContext to an instance of MainViewModel.
Essentially, what we are doing here is taking a class and assigning that class to the DataContext of the XAML code file. This means that anything in that file can now be bound to the frontend XAML.
Read now
Unlock full access