public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> state)
        {
            Template10.Common.BootStrapper.Current.NavigationService.FrameFacade.BackRequested += MasterDetailViewControl.NavigationManager_BackRequested;
            MasterDetailViewControl.LoadLayout();

            if (FriendScrollingCollection == null || !FriendScrollingCollection.Any())
            {
                SetFriendList();
            }
        }
 public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> state)
 {
     Template10.Common.BootStrapper.Current.NavigationService.FrameFacade.BackRequested += MasterDetailViewControl.NavigationManager_BackRequested;
     MasterDetailViewControl.LoadLayout();
     if (FriendScrollingCollection == null || !FriendScrollingCollection.Any())
     {
         SetFriendsList(Shell.Instance.ViewModel.CurrentUser.Username, false, false, false, false, true, false, false);
     }
     if (StickerListViewModel.StickerList == null || !StickerListViewModel.StickerList.Any())
     {
         await StickerListViewModel.GetStickerPacks();
     }
     if (MessageGroupCollection == null || !MessageGroupCollection.Any())
     {
         await GetMessageGroups(Shell.Instance.ViewModel.CurrentUser.Username);
     }
     try
     {
         if (state.ContainsKey("Thread"))
         {
             if (Selected == null)
             {
                 Selected = JsonConvert.DeserializeObject <MessageGroupItem>(state["Thread"]?.ToString());
             }
         }
         if (state.ContainsKey("SelectedMessageGroup"))
         {
             if (SelectedMessageGroup == null)
             {
                 SelectedMessageGroup = JsonConvert.DeserializeObject <MessageGroup>(state["SelectedMessageGroup"]?.ToString());
                 await GetMessages(SelectedMessageGroup);
             }
         }
         state.Clear();
     }
     catch (Exception)
     {
         // State didn't save
     }
 }
Exemple #3
0
 public void Load(string forumJson)
 {
     Forum = JsonConvert.DeserializeObject <Forum>(forumJson);
     MasterDetailViewControl.SetMasterHeaderText(Forum.Name);
     Init();
 }