//Attach flyout to playlist button private void MainPageTransportControls_Loaded(object sender, RoutedEventArgs e) { var button = MainPageTransportControls.GetPlayListButton(); var f = new Flyout(); f.Content = MainPageNowPlayingListView; f.FlyoutPresenterStyle = new Style(typeof(FlyoutPresenter)); f.FlyoutPresenterStyle.Setters.Add(new Setter(FlyoutPresenter.PaddingProperty, "0")); f.FlyoutPresenterStyle.Setters.Add(new Setter(FlyoutPresenter.BackgroundProperty, "Transparent")); f.FlyoutPresenterStyle.Setters.Add(new Setter(FlyoutPresenter.BorderThicknessProperty, "0")); button.Flyout = f; button.Click += Button_Click; }
public void animateMeidaTransportControl(string title, string cover) { var textbox = MainPageTransportControls.GetAlbumTitleTextbox(); var TextBlockVisual = ElementCompositionPreview.GetElementVisual(textbox); TextBlockVisual.RotationAxis = new Vector3(1, 0, 0); TextBlockVisual.CenterPoint = new Vector3((float)textbox.ActualWidth / 2, (float)textbox.ActualHeight / 2, 0); textbox.Text = title; TextBlockVisual.StartAnimation("RotationAngleInDegrees", textFlipAnimation); var image = MainPageTransportControls.GetAlbumCoverImage(); var imageVisual = ElementCompositionPreview.GetElementVisual(image); imageVisual.RotationAxis = new Vector3(1, 0, 0); imageVisual.CenterPoint = new Vector3((float)image.ActualWidth / 2, (float)image.ActualHeight / 2, 0); MainPageTransportControls.GetAlbumCoverImage().Source = new BitmapImage(new Uri(cover)); imageVisual.StartAnimation("RotationAngleInDegrees", imageFlipAnimation); }