Esempio n. 1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            SelectApiItem = e.Parameter as ApiItem;
            // Register for hardware and software back request from the system
        }
Esempio n. 2
0
        }                                                           //api子项集合


        public ObservableCollection <ApiModule> getApiModule(int size)
        {
            ObservableCollection <ApiModule> apiModules = new ObservableCollection <ApiModule>();

            for (int i = 0; i < size; i++)
            {
                ApiModule apiModule = new ApiModule {
                    Module_name = "aaa", Create_time = "2015-05-9", Description = "asdasdasdasdasd"
                };

                ObservableCollection <ApiItem> apiItems = new ObservableCollection <ApiItem>();
                ApiItem apiItem = new ApiItem {
                    Summary = "asdasd", CreateTime = "2013-5-5", Path = "/users"
                };

                apiItems.Add(apiItem);
                apiItems.Add(apiItem);
                apiItems.Add(apiItem);
                apiItems.Add(apiItem);
                apiItems.Add(apiItem);

                apiModule.ApiItems = apiItems;
                apiModules.Add(apiModule);
            }

            return(apiModules);
        }
Esempio n. 3
0
        public ObservableCollection<ApiModule> getApiModule(int size)
        {
            ObservableCollection<ApiModule> apiModules = new ObservableCollection<ApiModule>();

            for (int i = 0; i < size; i++)
            {
                ApiModule apiModule = new ApiModule{ Module_name = "aaa" , Create_time="2015-05-9" , Description = "asdasdasdasdasd"};

                ObservableCollection<ApiItem> apiItems = new ObservableCollection<ApiItem>();
                ApiItem apiItem = new ApiItem { Summary = "asdasd" , CreateTime = "2013-5-5" , Path = "/users"};

                apiItems.Add(apiItem);
                apiItems.Add(apiItem);
                apiItems.Add(apiItem);
                apiItems.Add(apiItem);
                apiItems.Add(apiItem);

                apiModule.ApiItems = apiItems;
                apiModules.Add(apiModule);
            }

            return apiModules;
        }
Esempio n. 4
0
 private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (PageSizeStatesGroup.CurrentState == WideState)
     {
         if (MasterListView.SelectedItems.Count == 1)
         {
             apiItem = MasterListView.SelectedItem as ApiItem;
             this.frame.Navigate(typeof(ApiItemDetailsPage), apiItem, new DrillInNavigationTransitionInfo());
         }
         // 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);
     }
 }
Esempio n. 5
0
 private void OnLoaded(object sender, RoutedEventArgs e)
 {
     if (apiItem == null && apiModules.Count > 0)
     {
         apiItem = apiModules[0].ApiItems[0];
         MasterListView.SelectedIndex = 0;
     }
     // 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 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 = apiItem;
     }
     else
     {
         new InvalidOperationException();
     }
 }
Esempio n. 6
0
        // 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.
        private void OnItemClick(object sender, ItemClickEventArgs e)
        {
            // The clicked item it is the new selected contact
            apiItem = e.ClickedItem as ApiItem;
            if (PageSizeStatesGroup.CurrentState == NarrowState)
            {
                // Go to the details page and display the item
                Frame.Navigate(typeof(ApiItemDetailsPage), apiItem, new DrillInNavigationTransitionInfo());
            }
            else
            {

                // Play a refresh animation when the user switches detail items.
                //EnableContentTransitions();
            }
        }
Esempio n. 7
0
 private void DeleteItems(object sender, RoutedEventArgs e)
 {
     if (MasterListView.SelectedIndex != -1)
     {
         List<ApiModule> selectedItems = new List<ApiModule>();
         foreach (ApiModule contact in MasterListView.SelectedItems)
         {
             selectedItems.Add(contact);
         }
         foreach (ApiModule contact in selectedItems)
         {
             apiModules.Remove(contact);
         }
         if (MasterListView.Items.Count > 0)
         {
             MasterListView.SelectedIndex = 0;
             apiItem = MasterListView.SelectedItem as ApiItem;
         }
         else
         {
         }
     }
 }
Esempio n. 8
0
        private void DeleteItem(object sender, RoutedEventArgs e)
        {
            if (apiItem != null)
            {

                //apiModules.Remove(ApiItem);

                if (MasterListView.Items.Count > 0)
                {
                    MasterListView.SelectedIndex = 0;
                    apiItem = MasterListView.SelectedItem as ApiItem;
                }
                else
                {
                    // Details view is collapsed, in case there is not items.
                }
            }
        }