private void CloseEditGrid() { EditProgramItemGrid.Children.Clear(); DisplayProgramItemGrid.Visibility = Visibility.Visible; DoubleAnimation fade = new DoubleAnimation(1.0, 0.0, TimeSpan.FromMilliseconds(fadeTime)); fade.Completed += (send, args) => { EditProgramItemGrid.Visibility = Visibility.Hidden; }; EditProgramItemGrid.ApplyAnimationClock(OpacityProperty, fade.CreateClock()); }
private void EditProperties(object sender, MouseButtonEventArgs e) { if (EditProgramItemGrid.Children.Count == 0) { EditableProgramItemControl epic = new EditableProgramItemControl((ProgramItemBase)ProgramItem.Clone()); epic.Cancel += CancelEdit; epic.Save += SaveProgramItem; EditProgramItemGrid.Children.Add(epic); } EditProgramItemGrid.Visibility = Visibility.Visible; DoubleAnimation fade = new DoubleAnimation(0.0, 1.0, TimeSpan.FromMilliseconds(fadeTime)); fade.Completed += (send, args) => { DisplayProgramItemGrid.Visibility = Visibility.Hidden; }; EditProgramItemGrid.ApplyAnimationClock(OpacityProperty, fade.CreateClock()); }