예제 #1
0
    /// <summary>
    /// Populates the page with content passed during navigation.  Any saved state is also
    /// provided when recreating a page from a prior session.
    /// </summary>
    /// <param name="sender">
    /// The source of the event; typically <see cref="NavigationHelper"/>
    /// </param>
    /// <param name="e">Event data that provides both the navigation parameter passed to
    /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
    /// a dictionary of state preserved by this page during an earlier
    /// session.  The state will be null the first time a page is visited.</param>
    private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) {
      var login = Frame.BackStack.FirstOrDefault(b => b.SourcePageType.Name == "LoginPage");
      if (login != null) {
        Frame.BackStack.Remove(login);
      }

      ((IViewModel)this.DataContext).LoadData(null);
    }
예제 #2
0
    /// <summary>
    /// Populates the page with content passed during navigation.  Any saved state is also
    /// provided when recreating a page from a prior session.
    /// </summary>
    /// <param name="sender">
    /// The source of the event; typically <see cref="NavigationHelper"/>
    /// </param>
    /// <param name="e">Event data that provides both the navigation parameter passed to
    /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
    /// a dictionary of state preserved by this page during an earlier
    /// session.  The state will be null the first time a page is visited.</param>
    private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) {
      // take out Register from Backstack list
      var register = Frame.BackStack.FirstOrDefault(b => b.SourcePageType.Name == "Register");
      if (register != null) {
        Frame.BackStack.Remove(register);
      }

    }
예제 #3
0
    /// <summary>
    /// Populates the page with content passed during navigation.  Any saved state is also
    /// provided when recreating a page from a prior session.
    /// </summary>
    /// <param name="sender">
    /// The source of the event; typically <see cref="NavigationHelper"/>
    /// </param>
    /// <param name="e">Event data that provides both the navigation parameter passed to
    /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
    /// a dictionary of state preserved by this page during an earlier
    /// session.  The state will be null the first time a page is visited.</param>
    private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) {

      if (DataSource.LoggedInInfo.PersonID == DataSource.SelectedUserInfo.PersonID) {
        // take out LoginPage from Backstack list
        // if Student logged in
        var login = Frame.BackStack.FirstOrDefault(b => b.SourcePageType.Name == "LoginPage");
        if (login != null) {
          Frame.BackStack.Remove(login);
        }
      }

      // hide newtest pivot if the logged in and selected user is not the same
      if (DataSource.SelectedUserInfo.PersonID != DataSource.LoggedInInfo.PersonID)
        pvt.Items.Remove(NewTestPivotItem);

      // hide the profil pivot if the logged in user is not student
      // because in this case the profil view is in loggedinuserpage
      if (DataSource.LoggedInInfo.RoleID != DataSource.GetRoleStudent().RoleID)
        pvt.Items.Remove(ProfilPivotItem);

      ((IViewModel)this.DataContext).LoadData(null);

    }
예제 #4
0
 /// <summary>
 /// Populates the page with content passed during navigation.  Any saved state is also
 /// provided when recreating a page from a prior session.
 /// </summary>
 /// <param name="sender">
 /// The source of the event; typically <see cref="NavigationHelper"/>
 /// </param>
 /// <param name="e">Event data that provides both the navigation parameter passed to
 /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
 /// a dictionary of state preserved by this page during an earlier
 /// session.  The state will be null the first time a page is visited.</param>
 private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) {
   ((IViewModel)this.DataContext).LoadData(null);
 }
예제 #5
0
 /// <summary>
 /// Populates the page with content passed during navigation.  Any saved state is also
 /// provided when recreating a page from a prior session.
 /// </summary>
 /// <param name="sender">
 /// The source of the event; typically <see cref="NavigationHelper"/>
 /// </param>
 /// <param name="e">Event data that provides both the navigation parameter passed to
 /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
 /// a dictionary of state preserved by this page during an earlier
 /// session.  The state will be null the first time a page is visited.</param>
 private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) {
   ((IViewModel)DataContext).LoadData(DataSource.CreateUserStudent());
 }