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; } }
private async void TaggedLVItemClick(object sender, ItemClickEventArgs e) { try { if (e.ClickedItem is InstaMedia media) { var index = ProfileDetailsVM.TaggedMediaGeneratror.Items.IndexOf(media); ScrollableUserTaggedPostUc.Visibility = Visibility.Visible; await Task.Delay(350); ScrollableUserTaggedPostUc.ScrollTo(index); } } catch { } }
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; } }