Пример #1
0
        public void SetUserControl(string str)
        {
            switch (str)
            {
            case "Home":
                UserControlProperty = new UserControl1();
                break;

            case "WeekGoals":
                UserControlProperty = new WeekGoalsUserControl(EmailAddressProperty);
                break;

            case "WeekDetails":
                UserControlProperty = new MonthChartUserControl(EmailAddressProperty);
                break;

            case "DailyFood":
                UserControlProperty = new AddDailyFoodUserControl(EmailAddressProperty);
                break;

            case "SearchFood":
                UserControlProperty = new SearchUserControl();
                break;

            case "LogOut":
                initLogIn();
                break;

            default:
                break;
            }
        }
Пример #2
0
        public MainViewModel()
        {
            this.searchUcViewModel   = new SearchUcViewModel(this);
            this.tourInfoUcViewModel = new TourInfoUcViewModel(this);
            this.tourListUcViewModel = new TourListUserControlViewModel(this);

            this.searchUserControl   = new SearchUserControl(searchUcViewModel);
            this.tourListUserControl = new TourListUserControl(tourListUcViewModel);
            this.tourInfoUserControl = new TourInfoUserControl(tourInfoUcViewModel);
        }