/CBR/CBR.Core/Helpers/MVVM/Events/Messages/PropertyChangedMessageBase.cs

# · C# · 71 lines · 25 code · 5 blank · 41 comment · 0 complexity · ae577c57ac5042adc1bc4d2167aec422 MD5 · raw file

  1. // ****************************************************************************
  2. // <copyright file="PropertyChangedMessageBase.cs" company="GalaSoft Laurent Bugnion">
  3. // Copyright © GalaSoft Laurent Bugnion 2009-2011
  4. // </copyright>
  5. // ****************************************************************************
  6. // <author>Laurent Bugnion</author>
  7. // <email>laurent@galasoft.ch</email>
  8. // <date>18.9.2009</date>
  9. // <project>GalaSoft.MvvmLight</project>
  10. // <web>http://www.galasoft.ch</web>
  11. // <license>
  12. // See license.txt in this solution or http://www.galasoft.ch/license_MIT.txt
  13. // </license>
  14. // ****************************************************************************
  15. ////using GalaSoft.Utilities.Attributes;
  16. namespace CBR.Core.Helpers
  17. {
  18. /// <summary>
  19. /// Basis class for the <see cref="PropertyChangedMessage{T}" /> class. This
  20. /// class allows a recipient to register for all PropertyChangedMessages without
  21. /// having to specify the type T.
  22. /// </summary>
  23. ////[ClassInfo(typeof(Messenger))]
  24. public abstract class PropertyChangedMessageBase : MessageBase
  25. {
  26. /// <summary>
  27. /// Initializes a new instance of the <see cref="PropertyChangedMessageBase" /> class.
  28. /// </summary>
  29. /// <param name="sender">The message's sender.</param>
  30. /// <param name="propertyName">The name of the property that changed.</param>
  31. protected PropertyChangedMessageBase(object sender, string propertyName)
  32. : base(sender)
  33. {
  34. PropertyName = propertyName;
  35. }
  36. /// <summary>
  37. /// Initializes a new instance of the <see cref="PropertyChangedMessageBase" /> class.
  38. /// </summary>
  39. /// <param name="sender">The message's sender.</param>
  40. /// <param name="target">The message's intended target. This parameter can be used
  41. /// to give an indication as to whom the message was intended for. Of course
  42. /// this is only an indication, amd may be null.</param>
  43. /// <param name="propertyName">The name of the property that changed.</param>
  44. protected PropertyChangedMessageBase(object sender, object target, string propertyName)
  45. : base(sender, target)
  46. {
  47. PropertyName = propertyName;
  48. }
  49. /// <summary>
  50. /// Initializes a new instance of the <see cref="PropertyChangedMessageBase" /> class.
  51. /// </summary>
  52. /// <param name="propertyName">The name of the property that changed.</param>
  53. protected PropertyChangedMessageBase(string propertyName)
  54. {
  55. PropertyName = propertyName;
  56. }
  57. /// <summary>
  58. /// Gets or sets the name of the property that changed.
  59. /// </summary>
  60. public string PropertyName
  61. {
  62. get;
  63. protected set;
  64. }
  65. }
  66. }