コード例 #1
0
 /// <summary>
 /// Method which occurs when the page is laid out, rendered, and ready for interaction.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     if (DidactictItem == null && AccountDetails.DidacticsItems.Count > 0)
     {
         DidactictItem = AccountDetails.DidacticsItems[0];
         MasterListView.SelectedIndex = 0;
     }
     // Start Project Nirvash
     // TODO: Implement Narrow State
     //// If the app starts in narrow mode - showing only the Master listView -
     //// it is necessary to set the commands and the selection mode.
     //if (PageSizeStatesGroup.CurrentState == NarrowState)
     //{
     //    VisualStateManager.GoToState(this, MasterState.Name, true);
     //}
     //else
     //{
     // Stop Project Nirvash
     if (PageSizeStatesGroup.CurrentState == WideState)
     {
         // In this case, the app starts is wide mode, Master/Details view,
         // so it is necessary to set the commands and the selection mode.
         VisualStateManager.GoToState(this, MasterDetailsState.Name, true);
         MasterListView.SelectionMode = ListViewSelectionMode.Extended;
         MasterListView.SelectedItem  = DidactictItem;
     }
     // Start Project Nirvash
     //else
     //{
     //    new InvalidOperationException();
     //}
     ContentAutoSuggestBox.Focus(FocusState.Keyboard);
     // Stop Project Nirvash
 }
コード例 #2
0
 /// <summary>
 /// Method which occurs when the currently selected item in MasterListView changes.
 /// Loads DetailList content.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void MasterListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (PageSizeStatesGroup.CurrentState == WideState)
     {
         if (MasterListView.SelectedItems.Count == 1)
         {
             DidactictItem = MasterListView.SelectedItem as Didactict;
             DetailContentPresenter.ContentTransitions.Clear();
             DetailContentPresenter.ContentTransitions.Add(new EntranceThemeTransition());
         }
         // Entering in Extended selection
         else
         {
             if (MasterListView.SelectedItems.Count > 1 && MasterDetailsStatesGroup.CurrentState == MasterDetailsState)
             {
                 VisualStateManager.GoToState(this, ExtendedSelectionState.Name, true);
             }
         }
     }
     // Exiting Extended selection
     if (MasterDetailsStatesGroup.CurrentState == ExtendedSelectionState && MasterListView.SelectedItems.Count == 1)
     {
         VisualStateManager.GoToState(this, MasterDetailsState.Name, true);
     }
 }
コード例 #3
0
 /// <summary>
 /// ItemClick event only happens when user is a Master state. In this state,
 /// selection mode is none and click event navigates to the details view.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ListView_ItemClick(object sender, ItemClickEventArgs e)
 {
     DidactictItem = e.ClickedItem as Didactict;
     // Start Project Nirvash
     // TODO: Implement Narrow State
     //if (PageSizeStatesGroup.CurrentState == NarrowState)
     //{
     //    NavigationService.Navigate(typeof(AttachmentsNarrowPage), DidactictItem, new DrillInNavigationTransitionInfo());
     //}
     // Stop Project Nirvash
 }
コード例 #4
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            didactict = e.Parameter as Didactict;
            // Register for hardware and software back request from the system
            SystemNavigationManager systemNavigationManager = SystemNavigationManager.GetForCurrentView();

            systemNavigationManager.BackRequested += OnBackRequested;
            //systemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
        }