Ejemplo n.º 1
0
        public async void OnAppearing()
        {
            var userList = await _userRepository.GetAllAsync <User>();

            foreach (var item in userList)
            {
                if (item.IsAuthorization)
                {
                    UserID = item.Id;
                    break;
                }
            }

            var profiles = await _profileRepository.GetAllAsync <Profile>();

            var profileList = profiles.Where(item => item.UserId == UserID);

            ProfileList = new ObservableCollection <Profile>(profileList);

            if (ProfileList.Count == 0)
            {
                NoProfilesAdded = "No profiles added.";
            }
            else
            {
                NoProfilesAdded = string.Empty;
            }

            foreach (var item in ProfileList)
            {
                item.IsSelected    = false;
                item.ListViewModel = this;
            }
        }
Ejemplo n.º 2
0
        public async void OnAppearing()
        {
            var userList = await _userRepository.GetAllAsync <User>();

            foreach (var item in userList)
            {
                if (item.IsAuthorization)
                {
                    UserID = item.Id;
                    break;
                }
            }

            var profileList = await _profileRepository.GetAllAsync <Profile>();

            ProfileList = new ObservableCollection <Profile>(profileList);

            foreach (var item in ProfileList)
            {
                if (item.IsSelected && FirstOnAppearing)
                {
                    NickName    = item.NickName;
                    Name        = item.Name;
                    Description = item.Description;
                    ImagePath   = item.ImagePath;

                    Saved            = true;
                    FirstOnAppearing = false;

                    break;
                }
            }
        }
Ejemplo n.º 3
0
        public async void OnAppearing()
        {
            var userList = await _userRepository.GetAllAsync <User>();

            foreach (var item in userList)
            {
                if (item.IsAuthorization)
                {
                    await _navigationService.NavigateAsync("MainListPage");

                    break;
                }
            }
        }