Drop use of CallerMemberName

This commit is contained in:
Manuel Thalmann 2024-03-22 02:35:19 +01:00
parent a872555f93
commit 1ac34c7625

View file

@ -2,7 +2,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using DT2; using DT2;
@ -35,7 +34,7 @@ namespace DT3 {
set set
{ {
size = value; size = value;
NotifyPropertyChanged(); NotifyPropertyChanged(nameof(Size));
} }
} }
@ -44,7 +43,7 @@ namespace DT3 {
set set
{ {
time = value; time = value;
NotifyPropertyChanged(); NotifyPropertyChanged(nameof(Time));
} }
} }
@ -53,14 +52,17 @@ namespace DT3 {
set set
{ {
url = value; url = value;
NotifyPropertyChanged(); NotifyPropertyChanged(nameof(Url));
var _ = urlTester.GetUrlAsync(Url); var _ = urlTester.GetUrlAsync(Url);
} }
} }
protected void NotifyPropertyChanged([CallerMemberName] string memberName = null) protected void NotifyPropertyChanged(string memberName)
{ {
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(memberName)); if (PropertyChanged != null)
{
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(memberName));
}
} }
} }