protected async override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     if (e.NavigationMode == NavigationMode.New || e.NavigationMode == NavigationMode.Back)
     {
         if (e.Parameter == null)
         {
             mid = ApiHelper.GetUserId();
         }
         else if (e.Parameter is object[])
         {
             mid = (e.Parameter as object[])[0].ToString();
         }
         else
         {
             mid = e.Parameter.ToString();
         }
         if (userCenterVM == null)
         {
             userCenterVM = new Modules.UserCenterVM(mid);
             await userCenterVM.GetUserDetail();
         }
         else if (userCenterVM.mid != mid)
         {
             userCenterVM.mid              = mid;
             userCenterVM.is_self          = mid == ApiHelper.GetUserId();
             userCenterVM.UserCenterDetail = null;
             userCenterVM.SubmitVideos.Clear();
             await userCenterVM.GetUserDetail();
         }
     }
 }
Пример #2
0
 protected async override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     if (e.NavigationMode == NavigationMode.New || userCenterVM == null)
     {
         if (e.Parameter == null)
         {
             mid = ApiHelper.GetUserId();
         }
         else if (e.Parameter is object[])
         {
             mid = (e.Parameter as object[])[0].ToString();
         }
         else
         {
             mid = e.Parameter.ToString();
         }
         userCenterVM     = new Modules.UserCenterVM(mid);
         this.DataContext = userCenterVM;
         await userCenterVM.GetUserDetail();
     }
 }