public async void SetMedia(string mediaId)
        {
            var media = await Helper.InstaApi.MediaProcessor.GetMediaByIdAsync(mediaId);

            if (media.Succeeded)
            {
                Media = media.Value;
                if (ScrollView == null)
                {
                    //if (NavigationMode == NavigationMode.Back) return;
                    ScrollView = ItemsLV.FindScrollViewer();
                    if (ScrollView != null)
                    {
                        ScrollView.ViewChanging += ScrollViewViewChanging;
                    }
                    CommentsVM.SetLV(ScrollView);
                }
                CommentsVM.ResetCache();
                ToggleGoUpButtonAnimation(false);
                if (Media != null)
                {
                    CommentsVM.SetMedia(Media);
                }
                CommentsVM.RunLoadMore(true);
            }
        }
Exemple #2
0
 private void CommentViewLoaded(object sender, RoutedEventArgs e)
 {
     try
     {
         RefreshControl.RefreshRequested -= RefreshControlRefreshRequested;
         RefreshControl.Visualizer.RefreshStateChanged -= RefreshControlRefreshStateChanged;
     }
     catch { }
     RefreshControl.RefreshRequested += RefreshControlRefreshRequested;
     if (RefreshControl.Visualizer != null)
     {
         RefreshControl.Visualizer.RefreshStateChanged += RefreshControlRefreshStateChanged;
     }
     if (NavigationMode == NavigationMode.Back && CommentsVM.Media != null)
     {
         if (CommentsVM.Media.InstaIdentifier == Media.InstaIdentifier)
         {
             return;
         }
     }
     else if (NavigationMode == NavigationMode.New)
     {
         NavigationCacheMode = NavigationCacheMode.Enabled;
         CanLoadFirstPopUp   = false;
     }
     if (!CanLoadFirstPopUp)
     {
         if (ScrollView == null)
         {
             //if (NavigationMode == NavigationMode.Back) return;
             ScrollView = ItemsLV.FindScrollViewer();
             ScrollView.ViewChanging += ScrollViewViewChanging;
             CommentsVM.SetLV(ScrollView);
         }
         CommentsVM.ResetCache();
         ToggleGoUpButtonAnimation(false);
         if (Media != null)
         {
             CommentsVM.SetMedia(Media);
         }
         else
         {
             CommentsVM.SetMedia(MediaId);
         }
         CommentsVM.RunLoadMore(true);
         CanLoadFirstPopUp = true;
     }
 }
        public void SetMedia(InstaMedia media)
        {
            Media = media;

            if (ScrollView == null)
            {
                //if (NavigationMode == NavigationMode.Back) return;
                ScrollView = ItemsLV.FindScrollViewer();
                if (ScrollView != null)
                {
                    ScrollView.ViewChanging += ScrollViewViewChanging;
                }
                CommentsVM.SetLV(ScrollView);
            }
            CommentsVM.ResetCache();
            ToggleGoUpButtonAnimation(false);
            if (Media != null)
            {
                CommentsVM.SetMedia(Media);
            }
            CommentsVM.RunLoadMore(true);
        }