'Window' does not contain a definition for 'Current'

Here is the error when creating a project from Unity 4.x

Error 5 ‘Window’ does not contain a definition for ‘Current’

public MainPage(SplashScreen splashScreen)
{
this.InitializeComponent();
splash = splashScreen;
GetSplashBackgroundColor();
OnResize();
onResizeHandler = new WindowSizeChangedEventHandler((o, e) => OnResize());
ERROR HERE Window.Current.SizeChanged += onResizeHandler;
}

And here is the fix:

public MainPage(SplashScreen splashScreen)
{
this.InitializeComponent();
splash = splashScreen;
GetSplashBackgroundColor();
OnResize();
onResizeHandler = new WindowSizeChangedEventHandler((o, e) => OnResize());
Windows.UI.Xaml.Window.Current.SizeChanged += onResizeHandler;
}

Did you submit a bug report?

No. It may not affect all users as it will only be an issue for people that have other objects that contain “Window” in the namespace.