示例#1
0
        private async void MyTeamsListView_ItemClick(object sender, ItemClickEventArgs e)
        {            
            try
            {
                NavigationParameterClass npc = new NavigationParameterClass();
                CollectionUsersTeam ruserteam = (CollectionUsersTeam)e.ClickedItem;

                Constants.CurrentTeamLatitude = Convert.ToDouble((string)ApplicationData.Current.LocalSettings.Values["team_latitude_" + ruserteam.id]);
                Constants.CurrentTeamLongitude = Convert.ToDouble((string)ApplicationData.Current.LocalSettings.Values["team_longitude_" + ruserteam.id]);

                await LibraryMethods.writeToLogFile((DateTime.UtcNow).ToString() + ": Storing ruserteam from clicked item", false);
                ApplicationData.Current.LocalSettings.Values["currentTeamID"] = ruserteam.id;
                Constants.CurrentTeamID = ruserteam.id;
                await LibraryMethods.writeToLogFile((DateTime.UtcNow).ToString() + ": Storing ruserteam", false);
                Constants.CurrentMemberIDforLoggedInUser = ruserteam.loggedInUsersmemberID;
                ApplicationData.Current.LocalSettings.Values["currentMemberIDforLoggedInUser"] = ruserteam.loggedInUsersmemberID;
                await LibraryMethods.writeToLogFile((DateTime.UtcNow).ToString() + ": Storing loggedInUsersMemberID from ruserteam", false);
                npc.dataClass = ruserteam;
                Frame rootFrame = Window.Current.Content as Frame;
                await LibraryMethods.writeToLogFile((DateTime.UtcNow).ToString() + ": Navigating to next page", false);
                rootFrame.Navigate(typeof(TeamPage), npc);
            }
            catch (Exception ex)
            {
                await LibraryMethods.writeToLogFile((DateTime.UtcNow).ToString() + ": Exception in MyTeamsListView_ItemClick", true);
            }
        }
示例#2
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     sortOrder.Visibility = Visibility.Collapsed;
     base.OnNavigatedTo(e);
     Frame rootFrame = Window.Current.Content as Frame;
     
     if (rootFrame.CanGoBack)
     {
         // If we have pages in our in-app backstack and have opted in to showing back, do so
         SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
     }
     else
     {
         // Remove the UI from the title bar if there are no pages in our in-app back stack
         SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
     }
     NavigationParameterClass npc = new NavigationParameterClass();
     npc = (NavigationParameterClass)e.Parameter;
     ruserteam = (CollectionUsersTeam)(npc.dataClass);
     //ruserteam = (CollectionUsersTeam)e.Parameter;
     
     var memberobject = ruserteam.members;
     rmembers.Clear();
     rmembers_nonplayer.Clear();
     foreach(var t_member in memberobject)
     {
         if (t_member.is_non_player == true)
         {
             rmembers_nonplayer.Add(t_member);
         }
         else
         {
             rmembers.Add(t_member);
         }
     }
     sortOrder.Visibility = Visibility.Visible;
     if (MobileGrid == null)
     {
         if (rmembers.Count <= 0)
         {
             DesktopRosterGridView.Visibility = Visibility.Collapsed;
             addYourTeamPlayerDesktop.Visibility = Visibility.Visible;
         }
        if (rmembers_nonplayer.Count <= 0)
         {
             DesktopRosterGridViewNonPlayer.Visibility = Visibility.Collapsed;
             addYourNonTeamPlayerDesktop.Visibility = Visibility.Visible;
         }
     }
     if (DesktopGrid == null)
     {
         if (rmembers.Count <= 0)
         {
             RosterListView.Visibility = Visibility.Collapsed;
             addYourTeamPlayerMobile.Visibility = Visibility.Visible;
         }
         else
         {
             RosterListView.Visibility = Visibility.Visible;
             addYourTeamPlayerMobile.Visibility = Visibility.Collapsed;
         }
         if (rmembers_nonplayer.Count <= 0)
         {
             RosterListViewNonPlayer.Visibility = Visibility.Collapsed;
             addYourNonTeamPlayerMobile.Visibility = Visibility.Visible;
         }
         else
         {
             RosterListViewNonPlayer.Visibility = Visibility.Visible;
             addYourNonTeamPlayerMobile.Visibility = Visibility.Collapsed;
         }
     }
 }
示例#3
0
 private void RosterButton_Click(object sender, RoutedEventArgs e)
 {
     NavigationParameterClass npc = new NavigationParameterClass();
     npc.dataClass = ruserteam;
     Frame rootFrame = Window.Current.Content as Frame;
     rootFrame.Navigate(typeof(Roster), npc);
 }