private void RegisterWithRootFrame()
{
InitializeTrackingFrame();
if (rootFrame == null)
{
#if NETFX_CORE
rootFrame = Window.Current.Content as Frame;
#else
rootFrame = Application.Current.RootVisual as Frame;
#endif
}
if (rootFrame != null)
{
SubscribeEvents();
}
else
{
#if NETFX_CORE
if (Window.Current.Content != null)
ErrorRootIsNotFrame();
Window.Current.VisibilityChanged += Current_VisibilityChanged;
#else
if (Application.Current.RootVisual != null)
ErrorRootIsNotFrame();
#endif
}
}