private void updateDetailsControl()
 {
     usrTrainingPlanSerieEditor1.Visible = getSelected <TrainingPlanSerie>() != null;
     usrTrainingPlanSerieEditor1.Fill(getSelected <TrainingPlanSerie>());
     UsrTrainingPlanEntryEditor1.Visible = getSelected <TrainingPlanEntry>() != null;
     UsrTrainingPlanEntryEditor1.Fill(getSelected <TrainingPlanEntry>());
 }
Exemple #2
0
        //private void tvDetails_BeforeLabelEdit(object sender, NodeLabelEditEventArgs e)
        //{
        //    if (!(e.Node.Tag is TrainingPlanDay))
        //    {
        //        e.CancelEdit = true;
        //        return;
        //    }

        //}

        //private void tvDetails_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        //{
        //    if (e.Label != null)
        //    {
        //        if ((e.Node.Tag is TrainingPlanDay))
        //        {
        //            TrainingPlanDay day = (TrainingPlanDay)e.Node.Tag;
        //            day.Name = e.Label;
        //            return;
        //        }
        //    }
        //}


        private void updateDetailsControl()
        {
            var selectedSet   = trainingPlanTreeView1.GetSelected <TrainingPlanSetViewModel>();
            var selectedEntry = trainingPlanTreeView1.GetSelected <TrainingPlanEntryViewModel>();

            usrTrainingPlanSerieEditor1.SetVisible(selectedSet != null);
            usrTrainingPlanSerieEditor1.Fill(selectedSet, viewModel);

            UsrTrainingPlanEntryEditor1.SetVisible(selectedEntry != null);
            UsrTrainingPlanEntryEditor1.Fill(selectedEntry != null ? selectedEntry : null, viewModel);
        }
        private void tvDetails_AfterSelect(object sender, TreeViewEventArgs e)
        {
            var selectedEntry = getSelected <TrainingPlanEntry>();

            if (selectedEntry != null)
            {
                UsrTrainingPlanEntryEditor1.Visible = true;
                UsrTrainingPlanEntryEditor1.Fill(selectedEntry);
            }
            else
            {
                UsrTrainingPlanEntryEditor1.Visible = false;
            }
            updateToolbar();

            updateDetailsControl();
        }