private async void LoadData()
        {
            try
            {
                if (ExploreGenerator == null)
                {
                    return;
                }
                //if (NavigationMode == NavigationMode.Back && ScrollableExplorePostVM.ExploreGenerator != null)
                //{
                //    if (ScrollableExplorePostVM.ExploreGenerator.ClusterId.ToLower().TrimAnyBullshits() == ExploreGenerator.ClusterId.ToLower().TrimAnyBullshits())
                //        return;
                //}
                //else if (NavigationMode == NavigationMode.New)
                //{
                //    NavigationCacheMode = NavigationCacheMode.Enabled;
                //    CanLoadFirstPopUp = false;
                //}
                if (!CanLoadFirstPopUp)
                {
                    try
                    {
                        LVPosts.ItemsSource = null;
                    }
                    catch { }
                    if (Scroll == null)
                    {
                        Scroll = LVPosts.FindScrollViewer();
                        if (Scroll != null)
                        {
                            Scroll.ViewChanging += ScrollViewViewChanging;
                        }
                    }
                    //LVPosts.ItemsSource = null;
                    //if (ScrollableExplorePostVM.ExploreGenerator != null)
                    //    ScrollableExplorePostVM.ExploreGenerator.ResetCache();
                    await Task.Delay(100);

                    ScrollableExplorePostVM.ExploreGenerator = ExploreGenerator;
                    await Task.Delay(100);

                    LVPosts.ItemsSource = ScrollableExplorePostVM.ExploreGenerator.Items;
                    //LVPosts.ItemsSource = ScrollableExplorePostVM.ExploreGenerator.ItemsX;
                    await Task.Delay(500);

                    if (Scroll != null)
                    {
                        Scroll.ViewChanging += ScrollableExplorePostVM.ExploreGenerator.ScrollViewChanging;
                    }
                    if (SelectedIndex != -1)
                    {
                        LVPosts.ScrollIntoView(ScrollableExplorePostVM.ExploreGenerator.Items[SelectedIndex]);
                    }
                    //LVPosts.ScrollIntoView(ScrollableExplorePostVM.ExploreGenerator.ItemsX[SelectedIndex]);

                    CanLoadFirstPopUp = true;
                }
            }
            catch { }
        }
        private async void ScrollableHashtagPostViewLoaded(object sender, RoutedEventArgs e)
        {
            ToggleGoUpButtonAnimation(false);
            try
            {
                if (NavigationMode == NavigationMode.Back && ScrollableHashtagPostVM.Hashtag != null)
                {
                    if (ScrollableHashtagPostVM.Hashtag.Name.ToLower().TrimAnyBullshits() == Hashtag.Name.ToLower().TrimAnyBullshits())
                    {
                        return;
                    }
                }
                else if (NavigationMode == NavigationMode.New)
                {
                    NavigationCacheMode = NavigationCacheMode.Enabled;
                    CanLoadFirstPopUp   = false;
                }
                if (!CanLoadFirstPopUp)
                {
                    if (Scroll == null)
                    {
                        Scroll = LVPosts.FindScrollViewer();
                        if (Scroll != null)
                        {
                            Scroll.ViewChanging += ScrollViewViewChanging;
                        }
                    }
                    //LVPosts.ItemsSource = null;
                    ScrollableHashtagPostVM.ResetCache();
                    await Task.Delay(100);

                    if (HashtagsRecentGenerator != null)
                    {
                        ScrollableHashtagPostVM.SetInfo(Hashtag, HashtagsRecentGenerator, Scroll);
                        LVPosts.ItemsSource = ScrollableHashtagPostVM.HashtagsRecentGenerator.Items;
                        //LVPosts.ItemsSource = ScrollableHashtagPostVM.HashtagsRecentGenerator.ItemsX;
                        await Task.Delay(500);

                        LVPosts.ScrollIntoView(ScrollableHashtagPostVM.HashtagsRecentGenerator.Items[SelectedIndex]);
                        //LVPosts.ScrollIntoView(ScrollableHashtagPostVM.HashtagsRecentGenerator.ItemsX[SelectedIndex]);
                    }
                    else
                    {
                        if (HashtagsTopGenerator != null)
                        {
                            ScrollableHashtagPostVM.SetInfo(Hashtag, HashtagsTopGenerator, Scroll);
                            LVPosts.ItemsSource = ScrollableHashtagPostVM.HashtagsTopGenerator.Items;
                            //LVPosts.ItemsSource = ScrollableHashtagPostVM.HashtagsTopGenerator.ItemsX;
                            await Task.Delay(500);

                            LVPosts.ScrollIntoView(ScrollableHashtagPostVM.HashtagsTopGenerator.Items[SelectedIndex]);
                            //LVPosts.ScrollIntoView(ScrollableHashtagPostVM.HashtagsTopGenerator.ItemsX[SelectedIndex]);
                        }
                    }
                    CanLoadFirstPopUp = true;
                }
            }
            catch { }
        }
示例#3
0
 public void ScrollTo(int index)
 {
     try
     {
         SelectedIndex = index;
         if (SelectedIndex != -1)
         {
             LVPosts.ScrollIntoView(HashtagsRecentGenerator.Items[SelectedIndex]);
         }
     }
     catch { }
 }
示例#4
0
 public void ScrollTo(int index)
 {
     try
     {
         SelectedIndex = index;
         if (SelectedIndex != -1)
         {
             LVPosts.ScrollIntoView(TaggedPostVM.Items[SelectedIndex]);
         }
     }
     catch { }
 }
 public void ScrollTo(int index)
 {
     try
     {
         SelectedIndex = index;
         if (SelectedIndex != -1)
         {
             LVPosts.ScrollIntoView(ScrollableExplorePostVM.ExploreGenerator.Items[SelectedIndex]);
         }
     }
     catch { }
 }
示例#6
0
 public void ScrollTo(int index)
 {
     try
     {
         SelectedIndex = index;
         if (SelectedIndex != -1)
         {
             LVPosts.ScrollIntoView(ScrollableUserPostVM.MediaGeneratror.Items[SelectedIndex]);
         }
     }
     catch { }
 }
示例#7
0
        private async void LoadData()
        {
            try
            {
                if (HashtagsRecentGenerator == null)
                {
                    return;
                }
                if (!CanLoadFirstPopUp)
                {
                    try
                    {
                        LVPosts.ItemsSource = null;
                    }
                    catch { }
                    if (Scroll == null)
                    {
                        Scroll = LVPosts.FindScrollViewer();
                        if (Scroll != null)
                        {
                            Scroll.ViewChanging += ScrollViewViewChanging;
                        }
                    }
                    await Task.Delay(100);

                    LVPosts.ItemsSource = HashtagsRecentGenerator.Items;
                    await Task.Delay(500);

                    if (Scroll != null)
                    {
                        Scroll.ViewChanging += HashtagsRecentGenerator.ScrollViewChanging;
                    }
                    if (SelectedIndex != -1)
                    {
                        LVPosts.ScrollIntoView(HashtagsRecentGenerator.Items[SelectedIndex]);
                    }

                    CanLoadFirstPopUp = true;
                }
            }
            catch { }
        }
        private async void ScrollableUserPostViewLoaded(object sender, RoutedEventArgs e)
        {
            ToggleGoUpButtonAnimation(false);
            try
            {
                if (NavigationMode == NavigationMode.Back && ScrollableUserPostVM.User != null)
                {
                    if (ScrollableUserPostVM.User.Pk == User.Pk)
                    {
                        return;
                    }
                }
                else if (NavigationMode == NavigationMode.New)
                {
                    NavigationCacheMode = NavigationCacheMode.Enabled;
                    CanLoadFirstPopUp   = false;
                }
                if (!CanLoadFirstPopUp)
                {
                    if (Scroll == null)
                    {
                        Scroll = LVPosts.FindScrollViewer();
                        if (Scroll != null)
                        {
                            Scroll.ViewChanging += ScrollViewViewChanging;
                        }
                    }
                    //LVPosts.ItemsSource = null;
                    ScrollableUserPostVM.ResetCache();

                    ScrollableUserPostVM.SetInfo(User?.ToUserShort(), MediaGeneratror, Scroll);
                    LVPosts.ItemsSource = ScrollableUserPostVM.MediaGeneratror.Items;
                    //LVPosts.ItemsSource = ScrollableUserPostVM.MediaGeneratror.ItemsX;
                    await Task.Delay(500);

                    LVPosts.ScrollIntoView(ScrollableUserPostVM.MediaGeneratror.Items[SelectedIndex]);
                    //LVPosts.ScrollIntoView(ScrollableUserPostVM.MediaGeneratror.ItemsX[SelectedIndex]);
                    CanLoadFirstPopUp = true;
                }
            }
            catch { }
        }