PageRenderTime 18ms CodeModel.GetById 10ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/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
16////using GalaSoft.Utilities.Attributes;
17
18namespace CBR.Core.Helpers
19{
20    /// <summary>
21    /// Basis class for the <see cref="PropertyChangedMessage{T}" /> class. This
22    /// class allows a recipient to register for all PropertyChangedMessages without
23    /// having to specify the type T.
24    /// </summary>
25    ////[ClassInfo(typeof(Messenger))]
26    public abstract class PropertyChangedMessageBase : MessageBase
27    {
28        /// <summary>
29        /// Initializes a new instance of the <see cref="PropertyChangedMessageBase" /> class.
30        /// </summary>
31        /// <param name="sender">The message's sender.</param>
32        /// <param name="propertyName">The name of the property that changed.</param>
33        protected PropertyChangedMessageBase(object sender, string propertyName)
34            : base(sender)
35        {
36            PropertyName = propertyName;
37        }
38
39        /// <summary>
40        /// Initializes a new instance of the <see cref="PropertyChangedMessageBase" /> class.
41        /// </summary>
42        /// <param name="sender">The message's sender.</param>
43        /// <param name="target">The message's intended target. This parameter can be used
44        /// to give an indication as to whom the message was intended for. Of course
45        /// this is only an indication, amd may be null.</param>
46        /// <param name="propertyName">The name of the property that changed.</param>
47        protected PropertyChangedMessageBase(object sender, object target, string propertyName)
48            : base(sender, target)
49        {
50            PropertyName = propertyName;
51        }
52
53        /// <summary>
54        /// Initializes a new instance of the <see cref="PropertyChangedMessageBase" /> class.
55        /// </summary>
56        /// <param name="propertyName">The name of the property that changed.</param>
57        protected PropertyChangedMessageBase(string propertyName)
58        {
59            PropertyName = propertyName;
60        }
61
62        /// <summary>
63        /// Gets or sets the name of the property that changed.
64        /// </summary>
65        public string PropertyName
66        {
67            get;
68            protected set;
69        }
70    }
71}