Last active
May 24, 2017 21:51
-
-
Save terriblememory/b3fa8b9c98ce42a4d22aabe2a66fdcd8 to your computer and use it in GitHub Desktop.
Minimal UWP App.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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