Exemplo n.º 1
0
        private void ProfileDetailsViewLoaded(object sender, RoutedEventArgs e)
        {
            //Loaded -= ProfileDetailsViewLoaded;
            ToggleGoUpButtonAnimation(false);
            ToggleRefreshButtonAnimation(false);
            if (NavigationMode == NavigationMode.New)
            {
                GetType().RemovePageFromBackStack();
            }
            try
            {
                if (NavigationMode == NavigationMode.New)
                {
                    if (ScrollableUserPostUc.Visibility == Visibility.Visible)
                    {
                        ScrollableUserPostUc.Visibility = Visibility.Collapsed;
                    }
                    if (ScrollableUserTaggedPostUc.Visibility == Visibility.Visible)
                    {
                        ScrollableUserTaggedPostUc.Visibility = Visibility.Collapsed;
                    }
                    if (ScrollableUserShopPostUc.Visibility == Visibility.Visible)
                    {
                        ScrollableUserShopPostUc.Visibility = Visibility.Collapsed;
                    }
                    try
                    {
                        if (GridMainScrollViewer != null)
                        {
                            GridMainScrollViewer.Height = double.NaN;
                        }
                    }
                    catch { }
                }
            }
            catch { }
            if (!CanLoadFirstPopUp)
            {
                ProfileDetailsVM.View = this;

                ProfileDetailsVM.SetBiographyTextBlock(BiographyText);
                if (!SetInfo)
                {
                    ProfileDetailsVM.SetInfo();
                    SetInfo = true;
                }
                ScrollableUserPostUc.SetData(Helper.CurrentUser.ToUserShort(), ProfileDetailsVM.MediaGeneratror);
                ScrollableUserTaggedPostUc.SetData(Helper.CurrentUser.ToUserShort(), ProfileDetailsVM.TaggedMediaGeneratror);
                ScrollableUserShopPostUc.SetData(Helper.CurrentUser.ToUserShort(), ProfileDetailsVM.ShopMediaGeneratror);
                CanLoadFirstPopUp = true;
            }
        }
Exemplo n.º 2
0
        private async void LVItemClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                if (e.ClickedItem is InstaMedia media)
                {
                    var index = ProfileDetailsVM.MediaGeneratror.Items.IndexOf(media);
                    //Helpers.NavigationService.Navigate(typeof(Posts.ScrollableUserPostView),
                    //    new object[] { ProfileDetailsVM.User, ProfileDetailsVM.MediaGeneratror, index });

                    ScrollableUserPostUc.Visibility = Visibility.Visible;
                    await Task.Delay(350);

                    ScrollableUserPostUc.MediaGeneratror.IsLoading = false;
                    ScrollableUserPostUc.ScrollTo(index);
                }
            }
            catch { }
        }
Exemplo n.º 3
0
        private void UserDetailsViewLoaded(object sender, RoutedEventArgs e)
        {
            //Loaded -= UserDetailsViewLoaded;
            ToggleGoUpButtonAnimation(false);
            ToggleRefreshButtonAnimation(false);
            if (NavigationMode == NavigationMode.Back && UserDetailsVM.User != null)
            {
                if (UserDetailsVM.User?.Pk == UserShort?.Pk)
                {
                    return;
                }
            }
            else if (NavigationMode == NavigationMode.Back && UserDetailsVM.User != null)
            {
                if (UserDetailsVM.User?.Pk == UserShortFriendship?.Pk)
                {
                    return;
                }
            }
            else if (NavigationMode == NavigationMode.Back && UserDetailsVM.User != null)
            {
                if (UserDetailsVM.User?.UserName?.ToLower() == Username?.ToLower())
                {
                    return;
                }
            }
            else if (NavigationMode == NavigationMode.New)
            {
                GetType().RemovePageFromBackStack();
                NavigationCacheMode = NavigationCacheMode.Enabled;
                CanLoadFirstPopUp   = false;
                //UserDetailsVM.MediaGeneratror.SetLV(SCMain);
                //UserDetailsVM.TVMediaGeneratror.SetLV(SCMain);
                //UserDetailsVM.TaggedMediaGeneratror.SetLV(SCMain);
                //UserDetailsVM.ShopMediaGeneratror.SetLV(SCMain);
            }
            try
            {
                if (NavigationMode == NavigationMode.New)
                {
                    if (ScrollableUserPostUc.Visibility == Visibility.Visible)
                    {
                        ScrollableUserPostUc.Visibility = Visibility.Collapsed;
                    }
                    if (ScrollableUserTaggedPostUc.Visibility == Visibility.Visible)
                    {
                        ScrollableUserTaggedPostUc.Visibility = Visibility.Collapsed;
                    }
                    if (ScrollableUserShopPostUc.Visibility == Visibility.Visible)
                    {
                        ScrollableUserShopPostUc.Visibility = Visibility.Collapsed;
                    }
                    try
                    {
                        if (GridMainScrollViewer != null)
                        {
                            GridMainScrollViewer.Height = double.NaN;
                        }
                    }
                    catch { }
                }
            }
            catch { }
            if (!CanLoadFirstPopUp)
            {
                UserDetailsVM.ResetToDefault();
                ResetUserImage();
                UserDetailsVM.View = this;


                IsTabCreated = false;
                if (ScrollableUserPostUc != null)
                {
                    ScrollableUserPostUc.Visibility = Visibility.Collapsed;
                }
                if (ScrollableUserTaggedPostUc != null)
                {
                    ScrollableUserTaggedPostUc.Visibility = Visibility.Collapsed;
                }
                if (ScrollableUserShopPostUc != null)
                {
                    ScrollableUserShopPostUc.Visibility = Visibility.Collapsed;
                }
                if (UserShort != null)
                {
                    UserDetailsVM.SetUser(UserShort);
                    ScrollableUserPostUc.SetData(UserShort, UserDetailsVM.MediaGeneratror);
                    ScrollableUserTaggedPostUc.SetData(UserShort, UserDetailsVM.TaggedMediaGeneratror);
                    ScrollableUserShopPostUc.SetData(UserShort, UserDetailsVM.ShopMediaGeneratror);
                }
                else if (UserShortFriendship != null)
                {
                    UserDetailsVM.SetUser(UserShortFriendship);
                    UpdateUserImage(UserShortFriendship.ProfilePicture);
                    ScrollableUserPostUc.SetData(UserShortFriendship.ToUserShort(), UserDetailsVM.MediaGeneratror);
                    ScrollableUserTaggedPostUc.SetData(UserShortFriendship.ToUserShort(), UserDetailsVM.TaggedMediaGeneratror);
                    ScrollableUserShopPostUc.SetData(UserShortFriendship.ToUserShort(), UserDetailsVM.ShopMediaGeneratror);
                }
                else if (!string.IsNullOrEmpty(Username))
                {
                    UserDetailsVM.SetUsername(Username);
                    ScrollableUserPostUc.SetData(new InstaUserShort {
                        UserName = Username
                    }, UserDetailsVM.MediaGeneratror);
                    ScrollableUserTaggedPostUc.SetData(new InstaUserShort {
                        UserName = Username
                    }, UserDetailsVM.TaggedMediaGeneratror);
                    ScrollableUserShopPostUc.SetData(new InstaUserShort {
                        UserName = Username
                    }, UserDetailsVM.ShopMediaGeneratror);
                }
                UserDetailsVM.SetBiographyTextBlock(BiographyText);
                CanLoadFirstPopUp = true;
            }
        }
Exemplo n.º 4
0
 private void UserDetailsViewLoaded(object sender, RoutedEventArgs e)
 {
     //Loaded -= UserDetailsViewLoaded;
     try
     {
         RefreshControl.RefreshRequested -= RefreshControlRefreshRequested;
         RefreshControl.Visualizer.RefreshStateChanged -= RefreshControlRefreshStateChanged;
     }
     catch { }
     RefreshControl.RefreshRequested += RefreshControlRefreshRequested;
     if (RefreshControl.Visualizer != null)
     {
         RefreshControl.Visualizer.RefreshStateChanged += RefreshControlRefreshStateChanged;
     }
     ToggleGoUpButtonAnimation(false);
     ToggleRefreshButtonAnimation(false);
     if (NavigationMode == NavigationMode.Back && UserDetailsVM.User != null)
     {
         if (UserDetailsVM.User?.Pk == UserShort?.Pk)
         {
             return;
         }
     }
     else if (NavigationMode == NavigationMode.Back && UserDetailsVM.User != null)
     {
         if (UserDetailsVM.User?.Pk == UserShortFriendship?.Pk)
         {
             return;
         }
     }
     else if (NavigationMode == NavigationMode.Back && UserDetailsVM.User != null)
     {
         if (UserDetailsVM.User?.UserName?.ToLower() == Username?.ToLower())
         {
             return;
         }
     }
     else if (NavigationMode == NavigationMode.New)
     {
         GetType().RemovePageFromBackStack();
         //this.ResetPageCache();
         //NavigationCacheMode = NavigationCacheMode.Disabled;
         NavigationCacheMode = NavigationCacheMode.Enabled;
         CanLoadFirstPopUp   = false;
     }
     try
     {
         if (NavigationMode == NavigationMode.New /*|| NavigationMode == NavigationMode.Refresh*/)
         {
             if (ScrollableUserPostUc.Visibility == Visibility.Visible)
             {
                 ScrollableUserPostUc.Visibility = Visibility.Collapsed;
             }
         }
     }
     catch { }
     if (!CanLoadFirstPopUp)
     {
         //if (!CanLoadFirstPopUp) return;
         UserDetailsVM.ResetToDefault();
         ResetUserImage();
         UserDetailsVM.View = this;
         if (UserShort != null)
         {
             UserDetailsVM.SetUser(UserShort);
             ScrollableUserPostUc.SetData(UserShort, UserDetailsVM.MediaGeneratror);
         }
         else if (UserShortFriendship != null)
         {
             UserDetailsVM.SetUser(UserShortFriendship);
             UpdateUserImage(UserShortFriendship.ProfilePicture);
             ScrollableUserPostUc.SetData(UserShortFriendship.ToUserShort(), UserDetailsVM.MediaGeneratror);
         }
         else if (!string.IsNullOrEmpty(Username))
         {
             UserDetailsVM.SetUsername(Username);
             ScrollableUserPostUc.SetData(new InstaUserShort {
                 UserName = Username
             }, UserDetailsVM.MediaGeneratror);
         }
         UserDetailsVM.SetBiographyTextBlock(BiographyText);
         CanLoadFirstPopUp = true;
     }
 }