Exemple #1
0
        protected internal void View_NavigatedCore(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            if (e != null)
            {
                if (CurrentChild != null)
                {
                    CurrentChild.InvokeOnNavigatedFrom(e);
                    CurrentChild.Cleanup();
                    CurrentChild = null;
                }

                MemoryCheck();

                Type key   = e.Content.GetType();
                var  child = Children[key];

                var element = e.Content as FrameworkElement;

                child.Parent   = this;
                child.ViewBase = element;

                CurrentChild = child;

                child.Initialize();

                child.InvokeOnNavigatedTo(e);
            }
        }
Exemple #2
0
        protected internal void View_NavigatedCore(object sender, NavigationEventArgs e)
        {
            try
            {
                if (e != null)
                {
                    if (CurrentChild != null)
                    {
                        CurrentChild.InvokeOnNavigatedFrom(e);
                        CurrentChild.Cleanup();
                        CurrentChild = null;
                    }

                    MemoryCheck();

                    Type key   = e.Content.GetType();
                    var  child = Children[key];

                    var element = e.Content as FrameworkElement;

                    child.Parent   = this;
                    child.ViewBase = element;

                    CurrentChild = child;

                    child.Initialize();

                    child.InvokeOnNavigatedTo(e);
                }
            }
            catch (Exception ex)
            {
                throw new IOException(null, ex);
            }
        }