I've written a UWP app using VS2017 and Windows Template Studio. I've created multiple pages by using the Pivot Page Navigation Template.
Here is the basic code:
public sealed partial class MainPage : Page, INotifyPropertyChanged
{
public MainPage()
{
InitializeComponent();
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
///Update controls here
base.OnNavigatedTo(e);
}
public event PropertyChangedEventHandler PropertyChanged;
private void Set<T>(ref T storage, T value, [CallerMemberName]string propertyName = null)
{
if (Equals(storage, value))
{
return;
}
storage = value;
OnPropertyChanged(propertyName);
}
private void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
I've added the "OnNavigatedTo" method, but it doesn't get called.
What am I doing wrong?