Beispiel #1
0
        public EditRequestorProfileViewModel(object owner)
        {
            var parentViewModel = (UserProfileUserControlViewModel)owner;

            this.parentViewModel = parentViewModel;
            if (parentViewModel != null)
            {
                var tempUserProfile = parentViewModel.UserProfile;
                if (tempUserProfile != null)
                {
                    Name             = tempUserProfile.Name;
                    Mobile           = tempUserProfile.Mobile;
                    Email            = tempUserProfile.Email;
                    SelectedCity     = tempUserProfile.City;
                    SelectedCountry  = tempUserProfile.Country;
                    ImagePath        = tempUserProfile.PathToProfileImage;
                    SelectedCategory = tempUserProfile.Category;
                    Company          = tempUserProfile.CompanyName;
                    CompanyAddress   = tempUserProfile.CompanyRegisteredAddress;
                    userSystemUUID   = tempUserProfile.SystemUUID;
                }
            }

            locationService        = new LocationService();
            userService            = new UserService();
            userProfileRepository  = new UserProfileRepository();
            userIdentityRepository = new UserIdentityRepository();
            SubmitProfileChangeCmd = new SubmitProfileChangeRequestorCommand(this);

            ChangeProfileImageCmd = new Xamarin.Forms.Command((e) =>
            {
                ChangeProfileImageAsync();
            }, (param) =>
            {
                if (param == null)
                {
                    return(false);
                }

                var isBusy = (bool)param;

                return(!isBusy);
            });

            LoadContractorOptions();

            this.SubscribeMeToThis(parentViewModel);
            PopulateLocations();
            LoadImageUploaderOptions();
        }
Beispiel #2
0
        public HomeViewModel(/*UserProfile userProfile*/ object owner)
        {
            dummyCmd                        = new DummyCommand(this);
            dummy2Cmd                       = new Dummy2Command(this);
            this.UserProfile                = (UserProfile)owner;
            HomeUserControlViewModel        = new HomeUserControlViewModel(this);
            UserProfileUserControlViewModel = new UserProfileUserControlViewModel(this);
            DashboardUserControlViewModel   = new DashboardUserControlViewModel(this);
            HistoryUserControlViewModel     = new HistoryUserControlViewModel(this);
            ContractorUserControlViewModel  = new ContractorUserControlViewModel(this);

            homeUserControlViewModel.SubscribeMeToThis(this);
            userProfileUserControlViewModel.SubscribeMeToThis(this);
            dashboardUserControlViewModel.SubscribeMeToThis(this);
            historyUserControlViewModel.SubscribeMeToThis(this);
            contractorUserControlViewModel.SubscribeMeToThis(this);
        }