Ejemplo n.º 1
0
        public bool Restore()
        {
            MobileDebug.Service.WriteEvent("Restore1", restoreHistory.Select(f => f.PageTypeName));
            //return false;

            if (restoreHistory.Count == 0)
            {
                return(false);
            }

            HistoricFrame        frame   = restoreHistory.Dequeue();
            HistoricFrameHandler handler = HistoricFrameHandler.GetHandler(frame.Page);

            parameter = handler.FromHistoricParameter(frame.Parameter, library);

            try
            {
                MobileDebug.Service.WriteEventPair("Restore2", "Page", frame.PageTypeName, "Parameter", parameter?.Value);
                //rootFrame.Navigate(typeof(MobileDebug.DebugPage), null);
                return(rootFrame.Navigate(frame.Page, parameter.Value));
            }
            catch (Exception e)
            {
                MobileDebug.Service.WriteEvent("RestoreFail", e, frame.PageTypeName, parameter.Value);
                restoreHistory.Clear();
                return(false);
            }
        }
Ejemplo n.º 2
0
        private void SaveDataContext()
        {
            if (history.Count == 0)
            {
                return;
            }

            HistoricFrame frame = history.Last();

            if (frame.Parameter.UseDataContext)
            {
                HistoricFrameHandler handler = HistoricFrameHandler.GetHandler(frame.Page);
                frame.Parameter.DataContext = handler.ToHistoricDataContext(GetCurrentPage().DataContext);
            }
        }