示例#1
0
        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
                            {
                            }
                        }
                    }
                };
            }
        }
示例#2
0
 private void GridScaleNormal(object sender, PointerRoutedEventArgs e) => SoundItemAnimations.ItemScaleNormal(sender as UIElement);
示例#3
0
 public static void GridScaleNormal(object sender, PointerRoutedEventArgs e)
 => SoundItemAnimations.ItemScaleNormal((UIElement)sender);