protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            Object[] param = e.Parameter as Object[];
            if (param != null)
            {
                parameter   = new ViewParameter(param);
                gui         = parameter.GetGui();
                application = parameter.GetApplication();

                // Since we do not need the parameter any more, overwrite them
                param = parameter.GetParameter();
                switch (parameter.GetAction())
                {
                case ViewParameter.Action.CategoryShow:
                    category = param[0] as ICategory;
                    Editable = false;
                    break;

                case ViewParameter.Action.CategoryCreate:
                    Editable = true;
                    break;

                case ViewParameter.Action.CategoryEdit:
                    category    = param[0] as ICategory;
                    categoryTmp = new Category(category.Name, category.Description);
                    Editable    = false;
                    break;

                default:
                    throw new NotImplementedException();
                }
            }
            base.OnNavigatedTo(e);
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            Object[] param = e.Parameter as Object[];
            if (param != null)
            {
                parameter   = new ViewParameter(param);
                gui         = parameter.GetGui();
                application = parameter.GetApplication();

                // Since we do not need the parameter any more, overwrite them
                param = parameter.GetParameter();
                switch (parameter.GetAction())
                {
                case ViewParameter.Action.ExcerciseShow:
                    excercise      = param[0] as IExcercise;
                    categoriesList = param[1] as ObservableCollection <Category>;
                    break;

                case ViewParameter.Action.ExcerciseCreate:
                    categoriesList = param[0] as ObservableCollection <Category>;
                    Editable       = true;
                    break;

                case ViewParameter.Action.ExcerciseEdit:
                    excercise      = param[0] as IExcercise;
                    excerciseTmp   = new Excercise(excercise.ID, excercise.Name, excercise.Description, excercise.Categories);
                    categoriesList = param[1] as ObservableCollection <Category>;
                    break;

                default:
                    throw new NotImplementedException();
                }
            }
            base.OnNavigatedTo(e);
        }
Exemple #3
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            Object[] param = e.Parameter as Object[];
            if (param != null)
            {
                parameter   = new ViewParameter(param);
                gui         = parameter.GetGui();
                application = parameter.GetApplication();

                // Since we do not need the parameter any more, overwrite them
                param = parameter.GetParameter();
                switch (parameter.GetAction())
                {
                case ViewParameter.Action.TrainingCreate:
                    excercisesAll = param[0] as ObservableCollection <Excercise>;
                    training      = new Training();
                    Editable      = true;
                    break;

                case ViewParameter.Action.TrainingShow:
                    training      = param[0] as ITraining;
                    excercisesAll = param[1] as ObservableCollection <Excercise>;
                    Editable      = false;
                    break;

                case ViewParameter.Action.TrainingEdit:
                    training      = param[0] as ITraining;
                    excercisesAll = param[1] as ObservableCollection <Excercise>;
                    trainingTmp   = new Training(training.ID, training.Name, training.Description, training.Excercises);
                    Editable      = true;
                    break;

                default:
                    throw new NotImplementedException();
                }
            }
            base.OnNavigatedTo(e);
        }
Exemple #4
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            Object[] param = e.Parameter as Object[];
            if (param != null)
            {
                ViewParameter parameter = new ViewParameter(param);
                gui         = parameter.GetGui();
                application = parameter.GetApplication();

                // Since we do not need the parameter any more, overwrite them
                param = parameter.GetParameter();
                switch (parameter.GetAction())
                {
                case ViewParameter.Action.TrainingShow:
                    trainingCollection = param[0] as ObservableCollection <Training>;
                    break;

                default:
                    throw new NotImplementedException();
                }
            }
            base.OnNavigatedTo(e);
        }