private void OnLoaded(object sender, RoutedEventArgs e) { ModernFrame parent = NavigationHelper.FindFrame(NavigationHelper.FrameParent, this); if (parent != null) { parent.RegisterChildFrame(this); } }
private void RegisterChildFrame(ModernFrame frame) { // do not register existing frame if (!GetChildFrames().Contains(frame)) { #if NET4 WeakReference r = new WeakReference(frame); #else var r = new WeakReference <ModernFrame>(frame); #endif childFrames.Add(r); } }