Ejemplo n.º 1
0
        private void otherModule_Tapped(object sender, TappedRoutedEventArgs e)
        {
            MenuItem selectedModule = sender as MenuItem;

            string selectedModuleId = selectedModule.Tag as string;

            int moduleIndex = Utils.DataManager.GetModuleIndexByModuleId(selectedModule.Tag as string);

            DataStructure.NavParams navParams = new DataStructure.NavParams(moduleIndex, -1);

            if (this.Frame != null)
            {
                this.Frame.Navigate(typeof(ItemPage), navParams);
            }
        }
        private void SearchResultTapped(object sender, ItemClickEventArgs e)
        {
            DataStructure.Searchable selectedResult = e.ClickedItem as DataStructure.Searchable;

            if (selectedResult != null)
            {
                if (selectedResult.announcementId != null)
                {
                    // this is an announcement
                    int moduleIndex = Utils.DataManager.GetModuleIndexByModuleId(selectedResult.moduleId);
                    int announcementIndex = Utils.DataManager.GetAnnouncementIndex(moduleIndex, selectedResult.announcementId);

                    DataStructure.NavParams navParams = new DataStructure.NavParams(moduleIndex, announcementIndex);

                    if (this.Frame != null)
                    {
                        this.Frame.Navigate(typeof(ItemPage), navParams);
                    }

                }
                else if (selectedResult.moduleId != null)
                {
                    // this is a module
                    int moduleIndex = Utils.DataManager.GetModuleIndexByModuleId(selectedResult.moduleId);
                    DataStructure.NavParams navParams = new DataStructure.NavParams(moduleIndex, -1);

                    if (this.Frame != null)
                    {
                        this.Frame.Navigate(typeof(ItemPage), navParams);
                    }
                }
            }
        }
Ejemplo n.º 3
0
 private void AnnoucementReleased(object sender, PointerRoutedEventArgs e)
 {
     DataStructure.Announcement selectedAnnouncement = (e.OriginalSource as FrameworkElement).DataContext as DataStructure.Announcement;
     
     foreach (DataStructure.Announcement announcement in Utils.DataManager.announcements)
     {
         announcement.announceColor = announcement.announcePrimaryColor;
         announcement.backgroundConverter = 1;
     }
     
     int moduleIndex = Utils.DataManager.GetModuleIndexByModuleId(selectedAnnouncement.announceModuleId);
     int announcementIndex = Utils.DataManager.GetAnnouncementIndex(moduleIndex, selectedAnnouncement.announceID);
     if (isRightClicking)
     {
         DataStructure.NavParams navParams = new DataStructure.NavParams(moduleIndex, announcementIndex);
         if (this.Frame != null)
         {
             this.Frame.Navigate(typeof(ItemPage), JsonConvert.SerializeObject(navParams));
         }
     }
     isRightClicking = false;
 }
Ejemplo n.º 4
0
 private void ModuleItemGridReleased(object sender, PointerRoutedEventArgs e)
 {
     DataStructure.Module selectedModule = (e.OriginalSource as FrameworkElement).DataContext as DataStructure.Module;
     
     if (selectedModule != null)
     {
         selectedModule.moduleShowColor = selectedModule.modulePrimaryColor;
         if (isRightClicking)
         {
             int moduleIndex = Utils.DataManager.GetModuleIndex(selectedModule);
             DataStructure.NavParams navParams = new DataStructure.NavParams(moduleIndex, -1);
             if (this.Frame != null)
             {
                 this.Frame.Navigate(typeof(ItemPage), JsonConvert.SerializeObject(navParams));
             }
         }
     }
     isRightClicking = false;
 }
Ejemplo n.º 5
0
        private void ModuleTileTapped(object sender, TappedRoutedEventArgs e)
        {
            // find the selected module and get the index of this module in module list
            // pass the index of the selected module as a parameter to module page
            DataStructure.Module selectedModule = (e.OriginalSource as FrameworkElement).DataContext as DataStructure.Module;
            int moduleIndex = Utils.DataManager.GetModuleIndex(selectedModule);

            DataStructure.NavParams navParams = new DataStructure.NavParams(moduleIndex, -1);

            if (this.Frame != null)
            {
                this.Frame.Navigate(typeof(ItemPage), JsonConvert.SerializeObject(navParams));
            }
        }
Ejemplo n.º 6
0
        private void AnnoucementTapped(object sender, TappedRoutedEventArgs e)
        {
            DataStructure.Announcement selectedAnnouncement = (e.OriginalSource as FrameworkElement).DataContext as DataStructure.Announcement;

            int moduleIndex = Utils.DataManager.GetModuleIndexByModuleId(selectedAnnouncement.announceModuleId);
            int announcementIndex = Utils.DataManager.GetAnnouncementIndex(moduleIndex, selectedAnnouncement.announceID);
            
            DataStructure.NavParams navParams = new DataStructure.NavParams(moduleIndex, announcementIndex);

            if (this.Frame != null)
            {
                this.Frame.Navigate(typeof(ItemPage), JsonConvert.SerializeObject(navParams));
            }
        }