private async void ItemContainer_PointerExited(object sender, PointerRoutedEventArgs e) { var rootElement = sender as FrameworkElement; var shadow = rootElement.FindDescendant <DropShadowPanel>(); if (shadow != null) { var animation = new OpacityAnimation() { To = 0, Duration = TimeSpan.FromMilliseconds(200) }; animation.StartAnimation(shadow); } var spotlight = rootElement.FindDescendant <ShadowSpotLightControl>(); if (spotlight != null) { var animation = new OpacityAnimation() { To = 0, Duration = TimeSpan.FromMilliseconds(200) }; animation.StartAnimation(spotlight); } var border = rootElement.FindDescendantByName("border"); if (border != null) { var animation = new OpacityAnimation() { To = 0, Duration = TimeSpan.FromMilliseconds(200) }; animation.StartAnimation(border); } var buttons = rootElement.FindDescendantByName("Buttons"); if (buttons != null) { var animation = new OpacityAnimation() { To = 0, Duration = TimeSpan.FromMilliseconds(200) }; animation.StartAnimation(buttons); } await Task.Delay(200); shadow.Visibility = Visibility.Collapsed; spotlight.Visibility = Visibility.Collapsed; border.Visibility = Visibility.Collapsed; buttons.Visibility = Visibility.Collapsed; }
private void NoteItem_Grid_PointerEntered(object sender, PointerRoutedEventArgs e) { ScaleAnimation animation = new ScaleAnimation() { To = "1.005", Duration = TimeSpan.FromMilliseconds(300) }; animation.StartAnimation(sender as UIElement); var shadowPanel = (sender as UIElement).GetFirstDescendantOfType <DropShadowPanel>(); var delBtn = (sender as UIElement).GetFirstDescendantOfType <Button>(); OpacityAnimation opacityAnimation = new OpacityAnimation() { To = 1, Duration = TimeSpan.FromMilliseconds(300) }; OpacityAnimation buttonOpacityAnimation = new OpacityAnimation() { To = 1, Duration = TimeSpan.FromMilliseconds(100) }; opacityAnimation.StartAnimation(shadowPanel); opacityAnimation.StartAnimation(delBtn); }
private void ItemContainer_PointerEntered(object sender, PointerRoutedEventArgs e) { var rootElement = sender as FrameworkElement; if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse || e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Pen) { var shadow = rootElement.FindDescendant <DropShadowPanel>(); if (shadow != null) { shadow.Visibility = Visibility.Visible; var animation = new OpacityAnimation() { To = 1, Duration = TimeSpan.FromMilliseconds(200) }; animation.StartAnimation(shadow); } var spotlight = rootElement.FindDescendant <ShadowSpotLightControl>(); if (spotlight != null) { spotlight.Visibility = Visibility.Visible; var animation = new OpacityAnimation() { To = 1, Duration = TimeSpan.FromMilliseconds(200) }; animation.StartAnimation(spotlight); } var border = rootElement.FindDescendantByName("border"); if (border != null) { border.Visibility = Visibility.Visible; var animation = new OpacityAnimation() { To = 1, Duration = TimeSpan.FromMilliseconds(200) }; animation.StartAnimation(border); } var buttons = rootElement.FindDescendantByName("Buttons"); if (buttons != null) { buttons.Visibility = Visibility.Visible; var animation = new OpacityAnimation() { To = 1, Duration = TimeSpan.FromMilliseconds(200), Delay = TimeSpan.FromMilliseconds(300) }; animation.StartAnimation(buttons); } } }
private void KanjiItem_Grid_PointerCaptureLost(object sender, PointerRoutedEventArgs e) { ScaleAnimation animation = new ScaleAnimation() { To = "1", Duration = TimeSpan.FromMilliseconds(600) }; animation.StartAnimation(sender as UIElement); var shadowPanel = (sender as UIElement).GetFirstDescendantOfType <DropShadowPanel>(); OpacityAnimation opacityAnimation = new OpacityAnimation() { To = 0, Duration = TimeSpan.FromMilliseconds(600) }; opacityAnimation.StartAnimation(shadowPanel); }
private void FlashcardItem_Grid_PointerCanceled(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e) { ScaleAnimation animation = new ScaleAnimation() { To = "1", Duration = TimeSpan.FromMilliseconds(600) }; animation.StartAnimation(sender as UIElement); var shadowPanel = (sender as UIElement).GetFirstDescendantOfType <DropShadowPanel>(); OpacityAnimation opacityAnimation = new OpacityAnimation() { To = 0, Duration = TimeSpan.FromMilliseconds(600) }; opacityAnimation.StartAnimation(shadowPanel); }
private void ItemContainer_PointerExited(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e) { var panel = (sender as FrameworkElement).FindDescendant <DropShadowPanel>(); if (panel != null) { var animation = new OpacityAnimation() { To = 0, Duration = TimeSpan.FromMilliseconds(1200) }; animation.StartAnimation(panel); var parentAnimation = new ScaleAnimation() { To = "1", Duration = TimeSpan.FromMilliseconds(1200) }; parentAnimation.StartAnimation(panel.Parent as UIElement); } }
private void PlayerFloating_PointerExited(object sender, PointerRoutedEventArgs e) { var panel = (sender as FrameworkElement).FindDescendant <DropShadowPanel>(); if (panel != null) { var animation = new OpacityAnimation() { To = 0, Duration = TimeSpan.FromMilliseconds(900) }; animation.StartAnimation(panel); var parentAnimation = new ScaleAnimation() { To = "1", Duration = TimeSpan.FromMilliseconds(900) }; parentAnimation.StartAnimation(panel.Parent as UIElement); } GC.Collect(); }
private void ItemContainer_PointerEntered(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e) { if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse) { var panel = (sender as FrameworkElement).FindDescendant <DropShadowPanel>(); if (panel != null) { panel.Visibility = Visibility.Visible; var animation = new OpacityAnimation() { To = 1, Duration = TimeSpan.FromMilliseconds(600) }; animation.StartAnimation(panel); var parentAnimation = new ScaleAnimation() { To = "1.1", Duration = TimeSpan.FromMilliseconds(600) }; parentAnimation.StartAnimation(panel.Parent as UIElement); } } }
private async void Container_Tapped(object sender, TappedRoutedEventArgs e) { var rootElement = sender as FrameworkElement; var shadow = rootElement.FindDescendant <DropShadowPanel>(); if (shadow != null) { var animation = new OpacityAnimation() { To = 0, Duration = TimeSpan.FromMilliseconds(200) }; animation.StartAnimation(shadow); } var spotlight = rootElement.FindDescendant <ShadowSpotLightControl>(); if (spotlight != null) { var animation = new OpacityAnimation() { To = 0, Duration = TimeSpan.FromMilliseconds(200) }; animation.StartAnimation(spotlight); } var border = rootElement.FindDescendantByName("border"); if (border != null) { var animation = new OpacityAnimation() { To = 0, Duration = TimeSpan.FromMilliseconds(200) }; animation.StartAnimation(border); } var buttons = rootElement.FindDescendantByName("Buttons"); if (buttons != null) { var animation = new OpacityAnimation() { To = 0, Duration = TimeSpan.FromMilliseconds(200) }; animation.StartAnimation(buttons); } await Task.Delay(200); shadow.Visibility = Visibility.Collapsed; spotlight.Visibility = Visibility.Collapsed; border.Visibility = Visibility.Collapsed; buttons.Visibility = Visibility.Collapsed; _storedItem = (sender as GridViewItem).Content; //clickGridViewItem = rootElement.FindDescendant<ImageEx>(); MainVM.SetClickList((e.OriginalSource as FrameworkElement).DataContext as ILocalListModel); var gridView = rootElement.FindAscendant <GridView>(); if (gridView.Name == "albums") { var ca1 = albums.PrepareConnectedAnimation("ca1", _storedItem, "Thumbnail"); } else { var ca1 = playlists.PrepareConnectedAnimation("ca1", _storedItem, "Thumbnail"); } Frame.Navigate(typeof(PlaylistDetailPage), MainVM, new SuppressNavigationTransitionInfo()); }