Ejemplo n.º 1
0
        public void Update(User user, LocalData localData)
        {
            Debug.WriteLine("[m] [GroupsView] Update running");

            User        = user;
            _localData  = localData;
            User.Groups = _localData.FindGroupsOfUser(User);

            if (user.Groups.Count == 0)
            {
                NoGroupsLabel.IsVisible = true;
                listView.IsVisible      = false;
            }
            else
            {
                NoGroupsLabel.IsVisible = false;
                listView.IsVisible      = true;

                Groups               = user.Groups;
                GroupTitles          = Groups.Select(x => x.Title).ToList();
                listView.ItemsSource = GroupTitles;

                BindingContext = this;
            }
        }
Ejemplo n.º 2
0
 private void UserRequestCompleted(User user, UserRequestDialog.RequestPurpose purpose)
 {
     if (purpose == UserRequestDialog.RequestPurpose.currentName)
     {
         _user = user;
         _localData.ChangeUser(user);
         user.Friends = _localData.FindFriendsOfUser(user);
         user.Groups  = _localData.FindGroupsOfUser(user);
         SetUserView();
         menu.SetButtonsEnable(true);
     }
     else if (purpose == UserRequestDialog.RequestPurpose.newFriendName)
     {
         _localData.AddNewFriend(_user, user);
         _user.Friends.Add(user);
         SetFriendsView(UI.Views.FriendsView.Mode.Editable);
     }
 }