private void OnSave(object sender, EventArgs e)
        {
            EditableProgramItemControl addProgramControl = (sender as EditableProgramItemControl);

            ProgramItems.Add(addProgramControl.ProgramItem);

            AddProgramGrid.Children.Remove(sender as EditableProgramItemControl);
        }
        private void CreateNewProgramItem(object sender, MouseButtonEventArgs e)
        {
            EditableProgramItemControl addProgramControl = new EditableProgramItemControl(new ProgramItem("Default name", ""));

            addProgramControl.Cancel += OnCancel;
            addProgramControl.Save   += OnSave;

            AddProgramGrid.Children.Add(addProgramControl);
        }
Esempio n. 3
0
        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());
        }