I found a solution myself.
I removed event hoopups in XAML markup and hook up all the events in Page.Loaded event, after all initialization is done.
void Page_Loaded(object sender, RoutedEventArgs e)
{
// do intialization
textbox1.Text = Settings.value1;
// other controls
// then hook up events
textbox1.TextChanged += textbox1_TextChanged;
// other controls
}
But this effectively defeats the purpose of XAML markup because in WPF/UWP we are persuaded/forced to use markup as much as possible.