/// <summary>
        /// Creates this instance.
        /// </summary>
        /// <returns></returns>
        public NavigationContext Create()
        {
            if (this.RequestContext.HttpContext.Items.Contains("brickpile:navigationContext"))
            {
                return this.RequestContext.HttpContext.Items["brickpile:navigationContext"] as NavigationContext;
            }

            using (IDocumentSession session = this.documentStore.OpenSession())
            {
                IPage[] pages = session.Load<IPage>(
                    this.routeResolverTrie.LoadTrie().GetAncestorIdsFor(
                        this.RequestContext.RouteData.GetCurrentPage<IPage>().Id,
                        true)).OrderBy(x => x.Metadata.SortOrder).ToArray();

                var navigationContext = new NavigationContext
                {
                    StartPage = pages.SingleOrDefault(x => x.Parent == null),
                    CurrentPage = this.RequestContext.RouteData.GetCurrentPage<IPage>(),
                    OpenPages = pages,
                    RequestContext = this.RequestContext
                };

                this.RequestContext.HttpContext.Items["brickpile:navigationContext"] = navigationContext;

                return navigationContext;
            }
        }
Esempio n. 2
0
        public SetupSequencer(PackageViewModel package)
        {
            Context = new NavigationContext(package);

             stateMachine = new SetupSequencerSM(Context);
             stateMachine.Start();
        }
        public void RecordNotificationReceived(NavigationContext context)
        {
            string value;
            if (context != null && context.QueryString.TryGetValue(PlatformAccess.BuddyPushKey, out value))
            {

                PlatformAccess.Current.OnNotificationReceived(value);
            }
        }
 internal static object GetDataContext(NavigationContext navContext)
 {
     string id;
     if (navContext != null && navContext.QueryString != null &&
         navContext.QueryString.TryGetValue(ViewModelIdArgumentName, out id))
     {
         return ViewModelsRegistry.GetAndDeregister(id);
     }
     return null;
 }
Esempio n. 5
0
 public override void StartupNavigation(NavigationContext navigationContext)
 {
     if (!_accountManager.IsRegistered)
     {
         ServiceLocator.Resolve<RegistrationViewModel>().Show();
     }
     else
     {
         ServiceLocator.Resolve<MainMenuViewModel>().Show();
     }
 }
Esempio n. 6
0
 public void LoadData(NavigationContext navigationContext)
 {
     _navigationContext = navigationContext;
       ReadQueryParameters();
       Reporting.ProfileId = _profileId;
       //ProfileName.Text = _profileName;
       //WebSiteUrl.Text = "{0} — {1}".FormatWith(_startDate.ToShortDateString(), _endDate.ToShortDateString());
       Reporting.Between(_startDate, _endDate).GetDashboardDataAsync(data => {
     Dispatcher.BeginInvoke(() => {
       DataContext = data;
     });
       });
 }
			public NavigationInfo(NavigationContext ctx, NavigationMode mode)
			{
				NavigationContext = ctx;
				NavigationMode = mode;

                // Checks for a continuation operation.
                IContinuationActivatedEventArgs e = App.Current.ViewModel.ContractContinuationActivatedEventArgs;
                ContinuationEventArgs = e;
                if (e != null)
                {
                    ContinuationOperation = e.ContinuationData.GetValueOrDefault<string>(ContinuationOperationKey);
                }
			}
Esempio n. 8
0
        public static IPlayFactory CreatePlayFactory(NavigationContext navigationContext)
        {
            var playType = (PlayType)Convert.ToInt32(navigationContext.QueryString["playtype"]);

            switch (playType)
            { 
                case PlayType.Download:
                    return new PlayDownloadFactory(Convert.ToInt32(navigationContext.QueryString["id"]));
                default:
                    var id = Convert.ToInt32(navigationContext.QueryString["id"]);
                    var index = Convert.ToInt32(navigationContext.QueryString["index"]);
                    return new PlayVodFactory(new PlayInfoHelp(id, index));
            }

        }
 public override void StartupNavigation(NavigationContext navigationContext)
 {
     if (!_accountManager.IsRegistered)
     {
         ServiceLocator.Resolve<RegistrationViewModel>().Show();
     }
     else
     {
         string number;
         if (navigationContext.QueryString.TryGetValue(IncomingCallArgument, out number) && !string.IsNullOrWhiteSpace(number))
         {
             ServiceLocator.Resolve<MainViewModel>().ShowAndCall(number);
         }
         else
         {
             ServiceLocator.Resolve<MainViewModel>().Show();
         }
     }
 }
 public void OnNavigatedTo(NavigationContext navigationContext)
 {
 }
 /// <summary>
 /// Starts navigation
 /// </summary>
 public abstract void StartupNavigation(NavigationContext navigationContext);
Esempio n. 12
0
 public void Deactivate(NavigationContext oldContext, NavigationContext newContext)
 {
     // We're temporary stepping out of our model context... We just hold our state
     // until we step in again.
 }
Esempio n. 13
0
 /// <summary>
 /// Returns the information whether the given navigation <paramref name="context"/> is a context which was already
 /// visited by this model. This method checks for the existence of the context variable <see cref="CONFIG_LOCATION_KEY"/>.
 /// </summary>
 /// <param name="context">Workflow navigation context to check.</param>
 /// <returns><c>true</c>, if the given <paramref name="context"/> contains the context variable
 /// <see cref="CONFIG_LOCATION_KEY"/>, else <c>false</c>.</returns>
 protected static bool IsInitialized(NavigationContext context)
 {
     return(context.ContextVariables.ContainsKey(CONFIG_LOCATION_KEY));
 }
Esempio n. 14
0
		/// <summary>
		/// Called by the page when the navigation is leaving it.
		/// </summary>
		/// <param name="e"></param>
		/// <param name="navctx"></param>
		public void OnPageNavigatingFrom(NavigatingCancelEventArgs e, NavigationContext navctx)
		{
			// Marks the page as invisible.
			IsPageVisible = false;
		}
		/// <summary>
		/// Initializes the view model from the navigation context.
		/// </summary>
		/// <remarks>The default behavior finds and binds to the right object depending
		/// on the Id field.</remarks>
		/// <param name="navCtx"></param>
		protected virtual void InitFromNavigation(NavigationContext navCtx)
		{
			// Parses the wherigo id parameter and tries to load its associed object.
			string rawWidParam;
			if (navCtx.QueryString.TryGetValue("wid", out rawWidParam))
			{
				int WidParam;
				if (int.TryParse(rawWidParam, out WidParam))
				{
                    WherigoObject wObject;
                    if (this.Model.Core.TryGetWherigoObject<WherigoObject>(WidParam, out wObject))
					{
						// The object has been found: keep it.
						this.WherigoObject = wObject;
					}
				}
			}

			// TODO: in case of nothing found, do something special ?
		} 
Esempio n. 16
0
 public void OnNavigatedTo(NavigationContext navigationContext)
 {
     throw new NotImplementedException();
 }
Esempio n. 17
0
 public bool IsNavigationTarget(NavigationContext navigationContext)
 {
     throw new NotImplementedException();
 }
 public void UpdateMenuActions(NavigationContext context, IDictionary <Guid, WorkflowAction> actions)
 {
 }
 public void Reactivate(NavigationContext oldContext, NavigationContext newContext)
 {
     // The last navigation data was not disabled so we don't need to enable it here
 }
 public void Deactivate(NavigationContext oldContext, NavigationContext newContext)
 {
     // Don't disable the current navigation data when we leave our model - the last navigation data must be
     // available in sub workflows, for example to make the GetMediaItemsFromCurrentView method work
 }
 public void ChangeModelContext(NavigationContext oldContext, NavigationContext newContext, bool push)
 {
 }
 public void ExitModelContext(NavigationContext oldContext, NavigationContext newContext)
 {
 }
Esempio n. 23
0
 public void OnNavigatedFrom(NavigationContext navigationContext)
 {
     this.ErrorMessage = string.Empty;
 }
Esempio n. 24
0
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            _gameId = (int)navigationContext.Parameters["SelectedGameId"];

            AutoRefreshOperation.Resume();
        }
Esempio n. 25
0
        public void AppInit(NavigationService navServiceParam, NavigationContext navContextParam)
        {
            // This is the primary location for special logic when entering the app.
            // Here is where we determine to go to the home screen or login screen.
            // And it will be the starting point for ALL tile entries

            // Instaniate here and not in the constructor
            // If you do it in the constructor the MainFrame will be null.
            navService = new MyNavigationService(navServiceParam as NavigationService);

            if(isStartup)
            {
                isStartup = false;
                popup.IsOpen = true;

                NavigationContext navContext = (navContextParam as NavigationContext);

                var settings = IsolatedStorageSettings.ApplicationSettings;
                User savedUser;
                //settings.Remove("appUser");
                settings.TryGetValue<User>("appUser", out savedUser);

                if (savedUser == null)
                {
                    popup.IsOpen = false;
                    GoToView(new NavigationMessage()
                    {
                        Source = this.GetType().Assembly.ToString(),
                        Destination = "Login",
                        OnStack = false
                    });
                }
                else
                {
                    CapitalServiceClient client = new CapitalServiceClient();
                    client.LoginCompleted += (s, e) =>
                    {
                        try
                        {
                            popup.IsOpen = false;

                            if (e.Result != null)
                            {
                                User = e.Result;

                                // Needed for Notification/Tile/Toast Config
                                Messenger.Default.Send(new ToastMessage());

                                if (navContext.QueryString.ContainsKey("Statement"))
                                {
                                    int id = Convert.ToInt32(navContext.QueryString["Statement"]);
                                    LoadStatement(id);
                                }
                                else
                                {
                                    GoToView(new NavigationMessage()
                                    {
                                        Source = this.GetType().Assembly.ToString(),
                                        Destination = "Home",
                                        OnStack = false
                                    });
                                }
                            }
                            else
                            {
                                GoToView(new NavigationMessage()
                                {
                                    Source = this.GetType().Assembly.ToString(),
                                    Destination = "Login",
                                    OnStack = false
                                });
                            }
                        }
                        catch(Exception)
                        {
                            //MessageBox.Show(ex.Message);

                            GoToView(new NavigationMessage()
                            {
                                Source = this.GetType().Assembly.ToString(),
                                Destination = "Login",
                                OnStack = false
                            });
                        }
                    };

                    client.LoginAsync(savedUser);
                }
            }
        }
Esempio n. 26
0
 public void OnNavigatedFrom(NavigationContext navigationContext)
 {
     AutoRefreshOperation.Pause();
 }
 private void SetPageTitle(Page sender, NavigationContext ctx)
 {
     if (ctx.QueryString.ContainsKey("pagetitle"))
     {
         sender.Title = Enumerable.FirstOrDefault<KeyValuePair<string, string>>(ctx.QueryString, (Func<KeyValuePair<string, string>, bool>) (kvp => (kvp.Key == "pagetitle"))).Value;
     }
     else
     {
         sender.Title = "Page title";
     }
 }
Esempio n. 28
0
 public void ExitModelContext(NavigationContext oldContext, NavigationContext newContext)
 {
     // settingsManager.Save(TRAKT_SETTINGS);
 }
 public void OnNavigatedFrom(NavigationContext navigationContext)
 {
     this.indexingService.DelayedIndexCollectionAsync(1000, SettingsClient.Get <bool>("Indexing", "IgnoreRemovedFiles"), false);
     this.collectionService.SaveMarkedFoldersAsync();
 }
Esempio n. 30
0
 public void ChangeModelContext(NavigationContext oldContext, NavigationContext newContext, bool push)
 {
     // Nothing to do here
 }
Esempio n. 31
0
 public bool CanEnterState(NavigationContext oldContext, NavigationContext newContext)
 {
     return(true);
 }
Esempio n. 32
0
 public void Reactivate(NavigationContext oldContext, NavigationContext newContext)
 {
     // Nothing to do here
 }
Esempio n. 33
0
 public void Reactivate(NavigationContext oldContext, NavigationContext newContext)
 {
     PrepareConfigLocation(oldContext, newContext);
 }
Esempio n. 34
0
 public abstract void ExecuteResult(NavigationContext context);
 public override void StartupNavigation(NavigationContext navigationContext)
 {
     //here you can parse arguments or check some logic and run needed page
     ServiceLocator.Resolve<MainViewModel>().Show();
 }
Esempio n. 36
0
			public NavigationInfo(NavigationContext ctx, NavigationMode mode, bool isTombstoneRecovery)
			{
				NavigationContext = ctx;
				NavigationMode = mode;
				IsTombstoneRecovery = isTombstoneRecovery;
			}
Esempio n. 37
0
 public void UpdateMenuActions(NavigationContext context, IDictionary <Guid, WorkflowAction> actions)
 {
     // Nothing to do here
 }
 public void EnterModelContext(NavigationContext oldContext, NavigationContext newContext)
 {
     Update();
     SetLayout();
 }
 public ComingToAbout(NavigationContext context)
 {
     Dto = new AboutDto();
     queryString = context.QueryString;
     DeserializeFromQueryString();
 }
Esempio n. 40
0
 public ScreenUpdateMode UpdateScreen(NavigationContext context, ref string screen)
 {
     return(ScreenUpdateMode.AutoWorkflowManager);
 }
 public override void OnNavigatedFrom(NavigationContext navigationContext)
 {
     ApplicationCommands.SaveProductCommand.UnregisterCommand(SaveCommand);
     ApplicationCommands.DeleteProductCommand.UnregisterCommand(DeleteProductCommand);
 }
Esempio n. 42
0
 void INavigationAware.OnNavigatedFrom(NavigationContext navigationContext)
 {
     // Intentionally not implemented.
 }
		/// <summary>
		/// Called by pages when they are navigated to.
		/// </summary>
		/// <param name="e"></param>
		/// <param name="navCtx"></param>
		public void OnPageNavigatedTo(NavigationEventArgs e, NavigationContext navCtx)
		{
			if (e.NavigationMode == NavigationMode.New || e.NavigationMode == NavigationMode.Refresh)
			{
				InitFromNavigation(navCtx);
			}
		}
Esempio n. 44
0
 public void OnNavigatedTo(NavigationContext navigationContext)
 {
     this.regionManager.RequestNavigate(RegionNames.FullPlayerSearchRegion, typeof(Empty).FullName);
 }
 /// <summary>
 /// Sets the value of the <see cref="NavigationContextProperty"/> attached property on the <paramref name="obje"/>.
 /// </summary>
 /// <param name="obj">The object to set the <see cref="NavigationContextProperty"/> on.</param>
 /// <param name="navigationContext">The navigation context to set</param>
 public static void SetNavigationContext(DependencyObject obj, NavigationContext navigationContext)
 {
     Guard.ArgumentNotNull(obj, "obj");
     obj.SetValue(NavigationContextProperty, navigationContext);
 }
Esempio n. 46
0
 public void OnNavigatedFrom(NavigationContext navigationContext)
 {
     this.regionManager.RequestNavigate(RegionNames.FullPlayerSearchRegion, typeof(SearchControl).FullName);
 }
Esempio n. 47
0
		/// <summary>
		/// Called by pages when they are navigated to.
		/// </summary>
		/// <param name="e"></param>
		/// <param name="navCtx"></param>
		public void OnPageNavigatedTo(NavigationEventArgs e, NavigationContext navCtx)
		{
			// Marks the page as visible.
			IsPageVisible = true;

			// Always perform the common initializations.
			NavigationInfo nav = new NavigationInfo(navCtx, e.NavigationMode);
			InitFromNavigationInternal(nav);
			
			// This view model needs to be init'ed only if the navigation 
			// gets to the associated page for the first time, or if
			// the app is recovering from being tombstoned.
			if (e.NavigationMode == NavigationMode.New || e.NavigationMode == NavigationMode.Refresh)
			{
				InitFromNavigation(nav);
			}
			else if (e.NavigationMode == NavigationMode.Back)
			{
				if (App.Current.ViewModel.HasRecoveredFromTombstone)
				{
					InitFromNavigation(nav);
				}
				else
				{
					OnPageNavigatedBackToOverride();
				}
			}
		}
Esempio n. 48
0
		/// <summary>
		/// Called by pages when they are navigated to.
		/// </summary>
		/// <param name="e"></param>
		/// <param name="navCtx"></param>
		public void OnPageNavigatedTo(NavigationEventArgs e, NavigationContext navCtx)
		{
			// Discards the navigation if we are recovering from tombstone.
			if (!e.IsNavigationInitiator)
			{
				// Navigates back home.
				App.Current.ViewModel.NavigationManager.NavigateToAppHome(true);
				return;
			}

			// Marks the page as visible.
			IsPageVisible = true;

			// Always perform the common initializations.
			NavigationInfo nav = new NavigationInfo(navCtx, e.NavigationMode, false);
			InitFromNavigationInternal(nav);
			
			// This view model needs to be init'ed only if the navigation 
			// gets to the associated page for the first time, or if
			// the app is recovering from being tombstoned.
			if (e.NavigationMode == NavigationMode.New || e.NavigationMode == NavigationMode.Refresh)
			{
				InitFromNavigation(nav);
			}
			else if (e.NavigationMode == NavigationMode.Back)
			{
				OnPageNavigatedBackToOverride();
			}
		}
Esempio n. 49
0
			public NavigationInfo(NavigationContext ctx, NavigationMode mode)
			{
				NavigationContext = ctx;
				NavigationMode = mode;
			}
Esempio n. 50
0
 public override void OnNavigatedTo(NavigationContext navigationContext)
 {
     base.OnNavigatedTo(navigationContext);
     Archive = navigationContext.Parameters.GetValue <PayrollArchiveModel>("archive");
 }
 public void Navigate(Page sender, NavigationContext ctx)
 {
     Func<INavigationMapping, bool> func = null;
     this.SetPageTitle(sender, ctx);
     string key = "";
     if (ctx.QueryString.TryGetValue("key", out key))
     {
         if (func == null)
         {
             func = m => m.Key.ToLower() == key.ToLower();
         }
         foreach (INavigationMapping mapping in Enumerable.Where<INavigationMapping>(this.NavigationMappings, func).ToList<INavigationMapping>())
         {
             mapping.Navigate(ctx, this.silentNavigation);
         }
         this.silentNavigation = false;
     }
     else
     {
         this.silentNavigation = false;
         throw new ArgumentException("Argument 'key' is missing");
     }
 }
 public bool IsNavigationTarget(NavigationContext navigationContext)
 {
     return(true);
 }
Esempio n. 53
0
 public void OnNavigatedFrom(NavigationContext navigationContext)
 {
 }
Esempio n. 54
0
 public void Reactivate(NavigationContext oldContext, NavigationContext newContext)
 {
     CheckScreenSaver();
 }