explanation of code

5 replies. Last post: October 8, 2012 4:58 AM by Yudi
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hi

can you please explain the code (bolded) -  thanks

// Selection, View States
        public ContactViewModel SelectedItem
        {
            get { return _selectedItem; }
            set
            {
                if (_selectedItem != value)
                {
                    if (_selectedItem != null)
                        _selectedItem.Contact.PropertyChanged -= new PropertyChangedEventHandler(Contact_PropertyChanged);
                    
                    if (value != null)
                        value.Contact.PropertyChanged += new PropertyChangedEventHandler(Contact_PropertyChanged);
                    _selectedItem = value;
                    OnPropertyChanged("SelectedItem");
                    OnPropertyChanged("SelectionStatus");
                    InvalidateCommands();
                }
            }
        }

 


All times are GMT -5. The time now is 7:35 AM.
Previous Next