1

Is there any way to shorten this copy-paste code? The 26 words that follows contain actually just 4 piece of information: The visibility, the type, the name of the property and the behavior (which is the same for every property all over the world).

private PrinterInfo _currentConfiguration;

public PrinterInfo CurrentConfiguration
{
    get { return _currentConfiguration; }
    set
    {
        if (_currentConfiguration != value)
        {
            _currentConfiguration = value;
            OnPropertyChanged("CurrentConfiguration");
        }
    }
}
Wim Ombelets
  • 5,097
  • 3
  • 39
  • 55
Revious
  • 7,816
  • 31
  • 98
  • 147

0 Answers0