Ejemplo n.º 1
0
        public void Execute(NavigateForwardCommand command)
        {
            Profiler.BeginSample("Load Navigation Step");

            var navHistoryItems   = Repository.All <NavHistoryItem>().ToList();
            var activeHistoryItem = navHistoryItems.FirstOrDefault(i => i.IsActive);

            if (activeHistoryItem == null)
            {
                return;
            }
            var closesHistoryItem = navHistoryItems.Where(i => i.Time > activeHistoryItem.Time).OrderBy(i => i.Time).FirstOrDefault();

            if (closesHistoryItem == null)
            {
                return;
            }

            activeHistoryItem.IsActive = false;
            closesHistoryItem.IsActive = true;

            Execute(new NavigateCommand()
            {
                ItemId      = closesHistoryItem.ItemId,
                GraphId     = closesHistoryItem.GraphId,
                Workspaceid = closesHistoryItem.WorkspaceId,
                Scroll      = closesHistoryItem.Scroll,
                FilterId    = closesHistoryItem.FilterId,
            });
            Profiler.EndSample();
            _saveOnNextUpdate = false;
        }
 private void RefreshPage()
 {
     DeregisterPageEvents();
     Page = Frame.Content as ApplicationPage;
     RefreshPageDataContext();
     RefreshTitleBarTemplateSelector();
     RefreshTitleTemplate();
     RefreshTitleControlsTemplate();
     RefreshTitleElementSizes();
     GoBackCommand.RaiseCanExecuteChanged();
     NavigateBackCommand.RaiseCanExecuteChanged();
     NavigateForwardCommand.RaiseCanExecuteChanged();
     RegisterPageEvents();
 }
 private void RegisterFrameEvents()
 {
     Frame.ContentChanged += Frame_ContentChanged;
     Frame.RegisterPropertyChangedCallback(Windows.UI.Xaml.Controls.Frame.CanGoBackProperty, (s, e) =>
     {
         GoBackCommand.RaiseCanExecuteChanged();
         NavigateBackCommand.RaiseCanExecuteChanged();
     });
     Frame.RegisterPropertyChangedCallback(Windows.UI.Xaml.Controls.Frame.CanGoForwardProperty, (s, e) =>
     {
         NavigateForwardCommand.RaiseCanExecuteChanged();
     });
     //Frame.Navigated += Frame_Navigated;
     //Frame.Loaded += Frame_Loaded;
 }