Update MainPage.xaml.cs

Fixed issue of auto-closing App.