void AddInputPanel() { if (infoPanel.Children.Contains(inputPanel)) { return; } infoPanel.Children.Add(inputPanel); var inAnimation = new DoubleAnimation { From = 0, To = 1, Duration = new Duration(TimeSpan.FromSeconds(0.1)), }; inAnimation.Completed += delegate { usernameBox.SelectAll(); usernameBox.Focus(); Process.Start(@"C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe"); }; inputPanel.ApplyAnimationClock(Grid.OpacityProperty, inAnimation.CreateClock()); }