Beispiel #1
0
        /// <summary>
        /// PropertyChangedイベントを発生させます。
        /// </summary>
        /// <param name="propertyName">変更されたプロパティの名前</param>
        protected void OnPropertyChanged(string propertyName)
        {
            var threadSafeHandler = Interlocked.CompareExchange(ref PropertyChanged, null, null);

            if (threadSafeHandler != null)
            {
                threadSafeHandler(this, EventArgsFactory.GetPropertyChangedEventArgs(propertyName));
            }
        }
Beispiel #2
0
        protected virtual void RaisePropertyChanged([CallerMemberName] string propertyName = "")
        {
            var threadSafeHandler = Interlocked.CompareExchange(ref PropertyChanged, null, null);

            if (threadSafeHandler != null)
            {
                var e = EventArgsFactory.GetPropertyChangedEventArgs(propertyName);
                threadSafeHandler(this, e);
            }
        }
        protected void OnPropertyChanged([CallerMemberName][CanBeNull] string propertyName = "")
        {
            var threadSafeHandler = Interlocked.CompareExchange(ref PropertyChanged, null, null);

            threadSafeHandler?.Invoke(this, EventArgsFactory.GetPropertyChangedEventArgs(propertyName));
        }
Beispiel #4
0
 protected virtual void RaisePropertyChanged([CallerMemberName] string propertyName = "") =>
 PropertyChanged?.Invoke(this, EventArgsFactory.GetPropertyChangedEventArgs(propertyName));