private void MainPage_GotFocus(object sender, RoutedEventArgs e) { FrameworkElement focus = FocusManager.GetFocusedElement() as FrameworkElement; if (focus != null) { if (focus.GetType() == typeof(GridViewItem)) { control = ((focus.FindDescendantByName("TemplateRoot")) as Grid); if (control != null) { try { SoundItemAnimations.ItemScaleUp(control, 1.1f); } catch { } } } focus.LostFocus += (f, g) => { if (focus.GetType() == typeof(GridViewItem)) { control = ((focus.FindDescendantByName("TemplateRoot")) as Grid); if (control != null) { try { SoundItemAnimations.ItemScaleNormal(control); } catch { } } } }; } }
private void GridScaleNormal(object sender, PointerRoutedEventArgs e) => SoundItemAnimations.ItemScaleNormal(sender as UIElement);
public static void GridScaleNormal(object sender, PointerRoutedEventArgs e) => SoundItemAnimations.ItemScaleNormal((UIElement)sender);