Ejemplo n.º 1
0
        private void LVPostsLoaded(object sender, RoutedEventArgs e)
        {
            try
            {
                KeyDown -= OnKeyDownHandler;
            }
            catch { }
            KeyDown += OnKeyDownHandler;
            try
            {
                if (sender == null)
                {
                    return;
                }
                if (Scroll == null)
                {
                    Scroll = LVPosts.FindScrollViewer();
                    if (Scroll != null)
                    {
                        Scroll.ViewChanging += ScrollViewViewChanging;

                        MediaGeneratror.SetLV(Scroll);
                    }
                }
            }
            catch { }
        }
        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 { }
        }
Ejemplo n.º 4
0
        private void LVPostsLoaded(object sender, RoutedEventArgs e)
        {
            var scroll = LVPosts.FindScrollViewer();

            MultiplePostVM.SetLV(scroll);
            if (scroll != null)
            {
                scroll.ViewChanging += ScrollViewViewChanging;
            }
        }
Ejemplo n.º 5
0
        private void MainView_Loaded(object sender, RoutedEventArgs e)
        {
            if (IsPageLoaded)
            {
                return;
            }
            var apis = Helper.InstaApiList.ToList();

            if (Helper.InstaApi != null)
            {
                apis.AddInstaApiX(Helper.InstaApi);
            }
            Helpers.MultiApiHelper.SetupPushNotification(apis);
            IsPageLoaded = true;
            ToggleGoUpButtonAnimation(false);
            if (Scroll == null)
            {
                Scroll = /*ScrollView*/ LVPosts.FindScrollViewer();
                if (Scroll != null)
                {
                    Scroll.ViewChanging += ScrollViewViewChanging;
                    Scroll.ViewChanged  += ScrollViewViewChanged;
                }
                //var pncm = Windows.Networking.PushNotifications.PushNotificationChannelManager.GetDefault();
                //var cc = await pncm.CreatePushNotificationChannelForApplicationAsync();
                //await Helper.InstaApi.PushProcessor.RegisterPush2Async(cc.Uri);
                MainVM.PostsGenerator.SetLV(Scroll /*ScrollView*/);
                TryToRefresh(true);
            }

            try
            {
                RefreshControl.RefreshRequested -= RefreshControlRefreshRequested;
                RefreshControl.Visualizer.RefreshStateChanged -= RefreshControlRefreshStateChanged;
            }
            catch { }
            RefreshControl.RefreshRequested += RefreshControlRefreshRequested;
            if (RefreshControl.Visualizer != null)
            {
                RefreshControl.Visualizer.RefreshStateChanged += RefreshControlRefreshStateChanged;
            }
            ////DotNetty.Transport.Bootstrapping.Bootstrap.DoResolveAndConnectAsync
            //Helper.InstaApi.PushClient.MessageReceived += PushClient_MessageReceived;
            //await Helper.InstaApi.PushClient.Start();

            //foreach(var item in Helper.InstaApiList)
            //{
            //    (item.GetLoggedUser().UserName + "  " + item.PushClient.IsShutdown).PrintDebug();
            //}
        }
Ejemplo n.º 6
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 { }
        }
Ejemplo n.º 8
0
        private void MainView_Loaded(object sender, RoutedEventArgs e)
        {
            if (IsPageLoaded)
            {
                return;
            }
            var apis = Helper.InstaApiList.ToList();

            if (Helper.InstaApi != null)
            {
                apis.AddInstaApiX(Helper.InstaApi);
            }
            Helpers.MultiApiHelper.SetupPushNotification(apis);
            IsPageLoaded = true;
            ToggleGoUpButtonAnimation(false);
            if (Scroll == null)
            {
                Scroll = LVPosts.FindScrollViewer();
                if (Scroll != null)
                {
                    Scroll.ViewChanging += ScrollViewViewChanging;
                }
                MainVM.PostsGenerator.SetLV(Scroll);
                TryToRefresh(true);
            }

            try
            {
                RefreshControl.RefreshRequested -= RefreshControlRefreshRequested;
                RefreshControl.Visualizer.RefreshStateChanged -= RefreshControlRefreshStateChanged;
            }
            catch { }
            RefreshControl.RefreshRequested += RefreshControlRefreshRequested;
            if (RefreshControl.Visualizer != null)
            {
                RefreshControl.Visualizer.RefreshStateChanged += RefreshControlRefreshStateChanged;
            }
            InitTheme();
        }
Ejemplo n.º 9
0
        public async void SetData(InstaUserShort user, UserDetailsTaggedMediasGenerator mediaGeneratror)
        {
            try
            {
                User            = user;
                MediaGeneratror = mediaGeneratror;
                if (!CanLoadFirstPopUp)
                {
                    try
                    {
                        LVPosts.ItemsSource = null;
                    }
                    catch { }
                    if (Scroll == null)
                    {
                        Scroll = LVPosts.FindScrollViewer();
                        if (Scroll != null)
                        {
                            Scroll.ViewChanging += ScrollViewViewChanging;
                        }
                    }
                    //LVPosts.ItemsSource = null;
                    //ScrollableUserPostVM.ResetCache();

                    ScrollableUserTaggedPostVM.SetInfo(User, MediaGeneratror, Scroll);
                    LVPosts.ItemsSource = ScrollableUserTaggedPostVM.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 { }
        }