Example #1
0
 public void Load()
 {
     NavigationItems.Clear();
     foreach (var friendLookupItem in _friendLookupProvider.GetLookups())
     {
         NavigationItems.Add(
             new NavigationItemViewModel(friendLookupItem.Id, friendLookupItem.DisplayValue, _eventAggregator));
     }
 }
        public void Load(int?friendId = null)
        {
            FriendGroupLookup = _friendGroupLookupProvider.GetLookups();

            var friend = friendId.HasValue
                ? _friendDataProvider.GetFriendById(friendId.Value)
                : new Friend()
            {
                Address = new Address(), Emails = new List <FriendEmail>()
            };

            Friend = new FriendWrapper(friend);
            Friend.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == nameof(Friend.IsChanged) || args.PropertyName == nameof(Friend.IsValid))
                {
                    InValidateCommands();
                }
            };
            InValidateCommands();
        }