| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="PropertyChangedMessageBase.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | namespace MyNet.Messaging; |
| | | 8 | | |
| | | 9 | | /// <summary> |
| | | 10 | | /// Basis class for the <see cref="PropertyChangedMessage{T}" /> class. This |
| | | 11 | | /// class allows a recipient to register for all PropertyChangedMessages without |
| | | 12 | | /// having to specify the type T. |
| | | 13 | | /// </summary> |
| | | 14 | | public abstract class PropertyChangedMessageBase : MessageBase |
| | | 15 | | { |
| | | 16 | | /// <summary> |
| | | 17 | | /// Initializes a new instance of the <see cref="PropertyChangedMessageBase" /> class. |
| | | 18 | | /// </summary> |
| | | 19 | | /// <param name="sender">The message's sender.</param> |
| | | 20 | | /// <param name="propertyName">The name of the property that changed.</param> |
| | | 21 | | protected PropertyChangedMessageBase(object sender, string propertyName) |
| | 0 | 22 | | : base(sender) => PropertyName = propertyName; |
| | | 23 | | |
| | | 24 | | /// <summary> |
| | | 25 | | /// Initializes a new instance of the <see cref="PropertyChangedMessageBase" /> class. |
| | | 26 | | /// </summary> |
| | | 27 | | /// <param name="sender">The message's sender.</param> |
| | | 28 | | /// <param name="target">The message's intended target. This parameter can be used |
| | | 29 | | /// to give an indication as to whom the message was intended for. Of course |
| | | 30 | | /// this is only an indication, amd may be null.</param> |
| | | 31 | | /// <param name="propertyName">The name of the property that changed.</param> |
| | | 32 | | protected PropertyChangedMessageBase(object sender, object target, string propertyName) |
| | 0 | 33 | | : base(sender, target) => PropertyName = propertyName; |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// Initializes a new instance of the <see cref="PropertyChangedMessageBase" /> class. |
| | | 37 | | /// </summary> |
| | | 38 | | /// <param name="propertyName">The name of the property that changed.</param> |
| | 0 | 39 | | protected PropertyChangedMessageBase(string propertyName) => PropertyName = propertyName; |
| | | 40 | | |
| | | 41 | | /// <summary> |
| | | 42 | | /// Gets or sets the name of the property that changed. |
| | | 43 | | /// </summary> |
| | | 44 | | public string PropertyName |
| | | 45 | | { |
| | | 46 | | get; |
| | | 47 | | protected set; |
| | | 48 | | } |
| | | 49 | | } |
| | | 50 | | |