public static void AnimateBackItemToList(ListViewBase list, object lastSelectedItem, ConnectedAnimation connectedAnimation) { list.ScrollIntoView(lastSelectedItem); if (list.GetType() == typeof(ListView)) { var item = (ListViewItem)list.ContainerFromItem(lastSelectedItem); if (item == null) { connectedAnimation.Cancel(); return; } var pane = (FrameworkElement)item.ContentTemplateRoot; var image = (Image)pane.FindName("PhotoImage"); if (image == null) { connectedAnimation.Cancel(); return; } image.Opacity = 0; image.Loaded += (_s, _e) => { image.Opacity = 1; connectedAnimation.TryStart(image); }; } else if (list.GetType() == typeof(AdaptiveGridView) || list.GetType() == typeof(GridView)) { var item = (GridViewItem)list.ContainerFromItem(lastSelectedItem); if (item == null) { connectedAnimation.Cancel(); return; } var pane = (FrameworkElement)item.ContentTemplateRoot; var image = (Image)pane.FindName("PhotoImage"); if (image == null) { connectedAnimation.Cancel(); return; } image.Opacity = 0; image.Loaded += (_s, _e) => { image.Opacity = 1; connectedAnimation.TryStart(image); }; } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("image"); imageAnimation?.TryStart(HeaderImage); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); HasWon = (e.Parameter as bool? ?? false); if (HasWon) { Title = "I don't always play games"; Subtitle = "But when I do, I win!"; Image = WINNER; } else { Title = "KABOOM!"; Subtitle = "You lost!"; Image = BOMB; } ConnectedAnimation animation = ConnectedAnimationService.GetForCurrentView().GetAnimation("cat"); if (animation != null) { animation.TryStart(txtImage); } }
//check protected override void OnNavigatedTo(NavigationEventArgs e) { DeckImage.Source = new BitmapImage(new Uri(BaseUri, App.viewModel.selectedDeck.Image)); DeckName.Text = App.viewModel.selectedDeck.Name; MasterToggle.IsChecked = App.viewModel.selectedDeck.Mastered; MarkToggle.IsChecked = App.viewModel.selectedDeck.Marked; PlayGrid.Visibility = Visibility.Collapsed; edite = false; ConnectedAnimation animation = ConnectedAnimationService.GetForCurrentView().GetAnimation("CoverImage"); //setting default card view to front if (animation != null) { animation.TryStart(DeckImage); } DetailFrame.Navigate(typeof(CardGridPage)); CardGridPage.front.ItemsSource = App.viewModel.cards; CardGridPage.back.ItemsSource = App.viewModel.cards; CardGridPage.front.Visibility = Visibility.Visible; CardGridPage.back.Visibility = Visibility.Collapsed; CardGridPage.front.IsMultiSelectCheckBoxEnabled = false; CardGridPage.back.IsMultiSelectCheckBoxEnabled = false; CardGridPage.front.SelectionMode = ListViewSelectionMode.None; CardGridPage.back.SelectionMode = ListViewSelectionMode.None; CardGridPage.front.IsItemClickEnabled = true; CardGridPage.back.IsItemClickEnabled = true; }
public void ButtonCollapse_OnClick(object sender, RoutedEventArgs e) { Common.PageExpandedPlayer.StartCollapseAnimation(); GridSongInfo.Visibility = Visibility.Visible; ConnectedAnimation anim1 = ConnectedAnimationService.GetForCurrentView().GetAnimation("SongTitle"); ConnectedAnimation anim2 = ConnectedAnimationService.GetForCurrentView().GetAnimation("SongImg"); ConnectedAnimation anim3 = ConnectedAnimationService.GetForCurrentView().GetAnimation("SongArtist"); anim3.Configuration = new DirectConnectedAnimationConfiguration(); if (anim2 != null) { anim2.Configuration = new DirectConnectedAnimationConfiguration(); } anim1.Configuration = new DirectConnectedAnimationConfiguration(); anim3?.TryStart(TbSingerName); anim1?.TryStart(TbSongName); if (AlbumImage.Visibility == Visibility.Visible) { anim2?.TryStart(AlbumImage); } ButtonExpand.Visibility = Visibility.Visible; ButtonCollapse.Visibility = Visibility.Collapsed; Common.PageExpandedPlayer.Dispose(); Common.PageExpandedPlayer = null; Common.PageMain.ExpandedPlayer.Content = new BlankPage(); //Common.PageMain.MainFrame.Visibility = Visibility.Visible; Common.PageMain.ExpandedPlayer.Visibility = Visibility.Collapsed; Common.PageMain.GridPlayBar.Background = Application.Current.Resources["SystemControlAcrylicElementMediumHighBrush"] as Brush; }
protected override void OnNavigatedTo(NavigationEventArgs e) { ConnectedAnimation animation = ConnectedAnimationService.GetForCurrentView().GetAnimation("projectView"); if (animation != null) { animation.TryStart(HeroImageCtl); } PreviousPage = e.SourcePageType; var project = e.Parameter as Project; if (project != null) { Project = project; // Set up the CollaboratorsBlock, since it can't be done with // just bindings CollaboratorsBlock.Text += String.Join(", ", Project.Collaborators.Select(c => c.Name)); } base.OnNavigatedTo(e); }
public void StartExpandAnimation() { Task.Run(() => { Invoke(() => { ImageAlbumContainer.Visibility = Visibility.Visible; TextBlockSinger.Visibility = Visibility.Visible; TextBlockSongTitle.Visibility = Visibility.Visible; ConnectedAnimation anim1 = ConnectedAnimationService.GetForCurrentView().GetAnimation("SongTitle"); ConnectedAnimation anim2 = ConnectedAnimationService.GetForCurrentView().GetAnimation("SongImg"); ConnectedAnimation anim3 = ConnectedAnimationService.GetForCurrentView().GetAnimation("SongArtist"); anim3.Configuration = new DirectConnectedAnimationConfiguration(); if (anim2 != null) { anim2.Configuration = new DirectConnectedAnimationConfiguration(); } anim1.Configuration = new DirectConnectedAnimationConfiguration(); anim3?.TryStart(TextBlockSinger); anim1?.TryStart(TextBlockSongTitle); anim2?.TryStart(ImageAlbumContainer); }); }); }
/// <summary>Edits the clicked MediaObject inside of the AdaptiveGridView.</summary> /// <param name="clickedItem">The clicked item.</param> private void EditCommand_ItemClicked(MediaObject clickedItem) { GetCurrentGrid(); switch (_storedItem.GetType().Name) { case "Game": _storedItemIndex = CreateObjectsViewModel.Games.IndexOf(clickedItem as Game); break; case "Image": _storedItemIndex = CreateObjectsViewModel.Images.IndexOf(clickedItem as Modell.ChallengeObjects.Image); break; case "Music": _storedItemIndex = CreateObjectsViewModel.Music.IndexOf(clickedItem as Music); break; } ConnectedAnimation animation = Collection.PrepareConnectedAnimation("forwardAnimation", _storedItem, "connectedElement"); SmokeGrid.Visibility = Visibility.Visible; ((SmokeGridChild.Children[0] as Grid).Children[0] as ImageEx).Source = _storedItem.URI; (SmokeGridChild.Children[1] as TextBox).Text = _storedItem.Name; animation.TryStart(SmokeGrid.Children[0]); }
internal void StartConnectedAnimation(ConnectedAnimation ani, string n) { if (FindName(n) is UIElement item) { ani.TryStart(item); } }
protected override void OnNavigatedTo(NavigationEventArgs e) { if (e == null) { return; } base.OnNavigatedTo(e); ConnectedAnimation anim = ConnectedAnimationService.GetForCurrentView().GetAnimation("ForwardConnectedAnimation"); if (anim != null) { anim.TryStart(TransitionReceiver); } if (e.Parameter is IconItem ownIcon) { icon = ownIcon; SymbolIconXAMLCodeSample.Code = SampleTemplateProvider.GetXAMLSymbolIconCodeFromGlyph(icon.Name); SymbolIconCSCodeSample.Code = SampleTemplateProvider.GetCSSymbolIconCodeFromGlyph(icon.Name); ButtonSymbolIconXAMLCodeSample.Code = SampleTemplateProvider.GetXAMLButtonIconFromSymbolName(icon.Name); ButtonSymbolIconCSCodeSample.Code = SampleTemplateProvider.GetCSButtonIconFromSymbolName(icon.Name); FontIconXAMLCodeSample.Code = SampleTemplateProvider.GetXAMLFontIconCodeFromGlyph(icon.StringGlyph); FontIconCSCodeSample.Code = SampleTemplateProvider.GetCSFontIconCodeFromGlyph(icon.StringGlyph); ButtonFontIconXAMLCodeSample.Code = SampleTemplateProvider.GetXAMLButtonIconFromGlyph(icon.StringGlyph); ButtonFontIconCSCodeSample.Code = SampleTemplateProvider.GetCSButtonIconFromGlyph(icon.StringGlyph); CustomIconCode.Code = SampleTemplateProvider.GetXAMLCustomizedFontIconCode(icon.StringGlyph, FontIconColorPicker.Color.ToString(), ((int)CustomIconFontSize.Value).ToString()); Bindings.Update(); } }
private void BasicGridView_ItemClick(object sender, ItemClickEventArgs e) { SaveState(); var gift = (e.ClickedItem as CustomDataObject); ConnectedAnimation animation = null; // Get the collection item corresponding to the clicked item. if (BasicGridView.ContainerFromItem(e.ClickedItem) is GridViewItem container) { // Stash the clicked item for use later. We'll need it when we connect back from the detailpage. _storedItem = container.Content; // Prepare the connected animation. // Notice that the stored item is passed in, as well as the name of the connected element. // The animation will actually start on the Detailed info page. animation = BasicGridView.PrepareConnectedAnimation("forwardAnimation", _storedItem, "connectedElement"); } SmokeGrid.DataContext = gift; SmokeGrid.Visibility = Visibility.Visible; animation.TryStart(destinationElement); }
protected override void OnNavigatedTo(NavigationEventArgs e) { ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("videoThumb"); if (imageAnimation != null) { imageAnimation.TryStart(MediaElementContainer); } Constants.MainPageRef.contentFrame.Navigated += ContentFrame_Navigated; SystemNavigationManager.GetForCurrentView().BackRequested += VideoPage_BackRequested; Constants.MainPageRef.Frame.Navigated += Frame_Navigated; //Set the focus to the video viewer viewer.Focus(FocusState.Programmatic); //Get the video data and play it StartVideo(Constants.activeVideoID); //Update likes/dislikes LikeDislikeControl.UpdateData(); //Update comments if (CommentsOptionComboBox.SelectedIndex == 0) { UpdateComments(CommentThreadsResource.ListRequest.OrderEnum.Relevance); } else { UpdateComments(CommentThreadsResource.ListRequest.OrderEnum.Time); } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); NavigationMode = e.NavigationMode; KeyDown += OnKeyDownHandler; if (e != null && e.Parameter != null) { try { ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("UserImage"); if (imageAnimation != null) { ImageAnimationExists = true; imageAnimation.TryStart(UserImage); } else { ImageAnimationExists = false; } } catch { } } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); //Window.Current.SetTitleBar(null); var viewType = PomodoroView.Views.FirstOrDefault(t => t.Name == (SettingsService.Current.ViewType ?? string.Empty)); if (viewType == null) { viewType = PomodoroView.Views.FirstOrDefault(); } if (_pomodoroViewType != viewType) { ChangePomodoroContent(viewType); } _pomodoroViewType = viewType; ConnectedAnimation animation = ConnectedAnimationService.GetForCurrentView().GetAnimation("backAnimation"); if (animation != null) { animation.TryStart(PomodoroContent); } }
public void LoadExternalProfile(object e) { if (e is InstaUserShort userShort && userShort != null) { ShowTVTab = false; UserShort = userShort; UserShortFriendship = null; Username = null; try { ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("UserImage"); if (imageAnimation != null) { ImageAnimationExists = true; imageAnimation.TryStart(UserImage); } else { ImageAnimationExists = false; } } catch { } }
public selectedGoalPage() { this.InitializeComponent(); ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("image"); if (imageAnimation != null) { titleBar.Opacity = 0; formGrid.Opacity = 0; goalImage.Opacity = 0; changeImageButton.Opacity = 0; // Wait for image opened. In future Insider Preview releases, this won't be necessary. goalImage.ImageOpened += (sender_, e_) => { goalImage.Opacity = 1; imageAnimation.TryStart(goalImage, new UIElement[] { titleBar, formGrid, changeImageButton }); titleBar.Opacity = 1; formGrid.Opacity = 1; changeImageButton.Opacity = 1; }; } }
protected override void LoadState(object parameter, Dictionary <string, object> pageState) { base.LoadState(parameter, pageState); ConnectedAnimation searchAniamtion = ConnectedAnimationService.GetForCurrentView().GetAnimation("Search"); if (searchAniamtion != null) { searchAniamtion.TryStart(Search); } if (parameter != null) { if (parameter is string query) { Search.Text = query; ViewModel = new SearchPageViewModel(); ViewModel.SearchTerm = query; ViewModel.SearchClick(); } else if (parameter is SearchPageViewModel) { ViewModel = parameter as SearchPageViewModel; } } }
public void LoadExternalProfile(object e) { if (e is InstaUserShort userShort && userShort != null) { //UserDetailsVM = new UserDetailsViewModel(); //DataContext = UserDetailsVM; UserShort = userShort; UserShortFriendship = null; Username = null; //NavigationCacheMode = NavigationCacheMode.Disabled; //NavigationCacheMode = NavigationCacheMode.Required; try { ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("UserImage"); if (imageAnimation != null) { ImageAnimationExists = true; //imageAnimation.Completed += ImageAnimationClose_Completed; //if (LatestGrid?.Name != InfoGrid.Name) // LatestGrid.Background = new SolidColorBrush(Helper.GetColorFromHex("#FF2E2E2E")); imageAnimation.TryStart(UserImage); //GridShadow.Visibility = GVSHOW.Visibility = Visibility.Collapsed; } else { ImageAnimationExists = false; } } catch { } }
public void AnimationEnter() { ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("Poster"); if (imageAnimation != null) { imageAnimation.TryStart(Frame); } }
/// <summary>Edits the clicked CrewMember inside of the AdaptiveGridView.</summary> /// <param name="clickedItem">The clicked item.</param> private void EditCommand_ItemClicked(CrewMember clickedCrew) { ConnectedAnimation animation = CrewGrid.PrepareConnectedAnimation("forwardAnimation", _storedMember, "connectedElement"); SmokeGrid.Visibility = Visibility.Visible; SmokeGridText.Text = _storedMember.CrewTag; animation.TryStart(SmokeGrid.Children[0]); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); //var test = AppCore.InstaApi.GetStoryFeedAsync(((InstaReelFeed)e.Parameter).User.Pk); if (e.Parameter is InstaReelFeed) { this.DataContext = ((InstaReelFeed)e.Parameter); var i = ((InstaReelFeed)e.Parameter); Flipviews.ItemsSource = i.Items; } if (e.Parameter is InstaStory) { this.DataContext = ((InstaStory)e.Parameter); var i = ((InstaStory)e.Parameter); Flipviews.ItemsSource = i.Items; } //for (int a = 0; a < i.Items.Count; a++) //{ // switch (i.Items[a].MediaType) // { // case 1: // SecondItemList.Add(6); // break; // case 2: // SecondItemList.Add(i.Items[a].VideoDuration); // break; // } //} //if(i.Items.Count > 0) //{ // _timer = new DispatcherTimer // { Interval = TimeSpan.FromSeconds(SecondItemList[0]) }; // _BarSecond.Maximum = (SecondItemList[0]); // Flipviews.ItemsSource = i.Items; // _timer.Tick += ChangeImage; // _value.Tick += ValueBar; // //Start the timer // //_timer.Start(); // //_value.Start(); //} ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("image"); if (imageAnimation != null) { imageAnimation.TryStart(Frame); } }
private void EditItemView_Loaded(object sender, RoutedEventArgs e) { ConnectedAnimation noseAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("nose"); if (noseAnimation != null) { noseAnimation.TryStart(HeaderImage); } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("avatar"); if (imageAnimation != null) { imageAnimation.TryStart(LogoImg); } }
protected override void OnNavigatedTo(NavigationEventArgs e) { ViewModel.CurrentOperator = e.Parameter as Operator; ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("ForwardConnectedAnimation"); if (imageAnimation != null) { _ = imageAnimation.TryStart(OperatorImage, new UIElement[] { OperatorNameStackPanel, OperatorStarRatingControl }); } base.OnNavigatedTo(e); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); ConnectedAnimation ca = ConnectedAnimationService.GetForCurrentView().GetAnimation("connect"); if (ca != null) { ca.TryStart(PageTitle); } }
protected override void OnNavigatedTo(NavigationEventArgs e) { if (IsSame) { try { ConnectedAnimation animation = ConnectedAnimationService.GetForCurrentView().GetAnimation("AlbumBackAnimation"); if (animation != null) { animation.Configuration = new DirectConnectedAnimationConfiguration(); Image image = ((GridViewControl.ContainerFromIndex(GridViewControl.SelectedIndex) as GridViewItem).ContentTemplateRoot as FrameworkElement).FindName("AlbumImage") as Image; animation.TryStart(image); } } catch (Exception) { } } SingerImage.ImageOpened += SingerImage_ImageOpened; if (e.Parameter is ArtistResult Artist) { SingerImage.Opacity = 0; var bitmapimage = new BitmapImage(); SingerImage.Source = bitmapimage; bitmapimage.UriSource = new Uri(Artist.Artist.Img1V1Url); CancelToken = new CancellationTokenSource(); Locker = new AutoResetEvent(false); if (IsSame) { SingerImage.Opacity = 1; return; } this.Artist = Artist; SingerName.Text = Artist.Artist.Name; SingerIntroName.Text = Artist.Artist.Name + "简介:"; SingerIntroText.Text = " " + (Artist.Artist.BriefDesc ?? "无简介"); if (Artist.Artist.Alias.Count != 0) { GroupName.Text = Artist.Artist.Alias[0]; } else { GroupName.Text = ""; } SongCount.Text = "单曲数: " + Artist.Artist.MusicSize.ToString(); MVCount.Text = "MV数: " + Artist.Artist.MvSize.ToString(); AlbumCount.Text = "专辑数: " + Artist.Artist.AlbumSize.ToString(); } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("SearchEllipse"); if (imageAnimation != null) { imageAnimation.TryStart(ListStackPanel); } }
/// <summary> /// Finish connected animations /// </summary> /// <param name="e"></param> protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("header"); if (imageAnimation != null) { imageAnimation.TryStart(HeaderText); } Shell.Instance.SetSelectedNavItem(HeaderText.Text); }
public void DoIt(object item) { try { ConnectedAnimation ConnectedAnimation = PlaylistContentView.PrepareConnectedAnimation("forwardAnimation", item, "connectedElement"); ConnectedAnimation.Configuration = new DirectConnectedAnimationConfiguration(); ConnectedAnimation.TryStart(destinationElement); } catch (Exception) { } }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); ConnectedAnimation imageAnimation = ConnectedAnimationService.GetForCurrentView().GetAnimation("logo"); if (imageAnimation != null) { imageAnimation.TryStart(LogoImg); } dispatcherQueue = DispatcherQueue.GetForCurrentThread(); _ = RefreshQrAsync(); }