String 如果字符串当前为null或空,则尝试设置默认字符串属性值

String 如果字符串当前为null或空,则尝试设置默认字符串属性值,string,properties,default,setter,String,Properties,Default,Setter,这是我的尝试,尽管它不起作用。我正在尝试这样设置: 通知ex1:CaseNumber:3342432您已修改FirstName,您已修改StartDate。 通知ex2案例编号:12131244结束日期已修改 虽然人们可以猜出这个问题指的是什么语言(特别是你的名字),但如果你给它加上适当的标签可能会更容易 public string NotificationMessage{ get => notificationMessage + ""; set {

这是我的尝试,尽管它不起作用。我正在尝试这样设置: 通知ex1:CaseNumber:3342432您已修改FirstName,您已修改StartDate。
通知ex2案例编号:12131244结束日期已修改

虽然人们可以猜出这个问题指的是什么语言(特别是你的名字),但如果你给它加上适当的标签可能会更容易
public string NotificationMessage{
   get => notificationMessage + "";
   set {
          if (!IsLoading && !IsSaving && string.IsNullOrWhiteSpace(NotificationMessage))
          {
              notificationMessage = $"Case# {CaseNumber}: ";
              SetPropertyValue(nameof(NotificationMessage), ref, notificationMessage, value);
          }
          else
          {   
             SetPropertyValue(nameof(NotificationMessage), ref, notificationMessage, value);
          }
     }     
}