public void Load(int?friendId)
        {
            Friend = friendId.HasValue
                ? new FriendWrapper(friendDataProvider.GetFriendById(friendId.Value))
                : new FriendWrapper(new Friend());

            Friend.PropertyChanged += Friend_PropertyChanged;
        }
        public void Load(int?friendId)
        {
            var friend = friendId.HasValue ?
                         _dataProvider.GetFriendById(friendId.Value) : new Friend();

            Friend = new FriendWrapper(friend);
            Friend.PropertyChanged += Friend_PropertyChanged;
            InvalidateCommands();
        }
Example #3
0
        public void Load(int friendId)
        {
            var friend = _dataProvider.GetFriendById(friendId);

            Friend = new FriendWrapper(friend);

            Friend.PropertyChanged += Friend_PropertyChanged;

            ((DelegateCommand)SaveCommand).RaiseCanExecuteChanged();
        }
Example #4
0
        public void Load(int?friendId)  //implementacja interfejsu wczytania frienda
        {
            var friend = friendId.HasValue
              ? _dataProvider.GetFriendById(friendId.Value)
              : new Friend();                                 //jak jest ID, to pobieranie z pliku, jak nie to tworzymy nowego

            Friend = new FriendWrapper(friend);               //tworzenie obiektu

            Friend.PropertyChanged += Friend_PropertyChanged; //jeśli się zmieni to +=

            InvalidateCommands();                             //spr czy można wykonać komendy
        }
        public void Load(int?friendId)
        {
            var friend = friendId.HasValue
        ? _dataProvider.GetFriendById(friendId.Value)
        : new Friend(); //nowy friend

            Friend = new FriendWrapper(friend);
            //ad 10
            Friend.PropertyChanged += Friend_PropertyChanged;
            //ad 11
            ((DelegateCommand)SaveCommand).RaiseCanExecuteChanged();
        }
Example #6
0
        public void Load(int?friendId = null)
        {
            FriendGroupLookup = _friendGroupLookupProvider.GetLookup();

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

            InvalidateCommands();
        }
Example #7
0
        public void Load(int?friendId = null)
        {
            FriendGroupLookup = _friendGroupLookupProvider.GetLookup();

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

            Friend = new FriendWrapper(friend);
            Friend.PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == nameof(Friend.IsChanged) || e.PropertyName == nameof(Friend.IsValid))
                {
                    InvalidateCommands();
                }
            };

            InvalidateCommands();
        }
 public void Load(int friendId)
 {
     Friend = _dataProvider.GetFriendById(friendId);
 }
        public void Load(int friendId)
        {
            var friend = _friendDataProvider.GetFriendById(friendId);

            Friend = friend;
        }
        public void Load(int friendId) //ad 5
        {
            var friend = _dataProvider.GetFriendById(friendId);

            Friend = friend;
        }