private void Exit3(object sender, EventArgs e) { DoubleAnimation a = new DoubleAnimation(176, TimeSpan.FromMilliseconds(500)); DeleteButton.BeginAnimation(WidthProperty, a); DoubleAnimation a1 = new DoubleAnimation(64, TimeSpan.FromMilliseconds(500)); DeleteButton.BeginAnimation(HeightProperty, a1); }