Skip to content

Instantly share code, notes, and snippets.

@terriblememory
Last active May 24, 2017 21:51
Show Gist options
  • Save terriblememory/b3fa8b9c98ce42a4d22aabe2a66fdcd8 to your computer and use it in GitHub Desktop.
Save terriblememory/b3fa8b9c98ce42a4d22aabe2a66fdcd8 to your computer and use it in GitHub Desktop.
Minimal UWP App.xaml.cs
// You don't need all of the crud the new project wizard barfs out.
using Windows.ApplicationModel.Activation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace MyThing
{
sealed partial class App : Application
{
public App()
{
this.InitializeComponent();
}
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
var rootFrame = Window.Current.Content as Frame;
if (rootFrame == null) Window.Current.Content = rootFrame = new Frame();
if (rootFrame.Content == null) rootFrame.Navigate(typeof(MainPage), e.Arguments);
Window.Current.Activate();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment