【发布时间】:2020-02-04 10:09:16
【问题描述】:
我正在尝试这个 MVVM 的东西,并且正在关闭 John Shews (A Minimal MVVM UWP App) 的博客文章。我想我了解大部分情况,除了NotificationBase 文件中的一小部分。
这是我无法理解的部分。
public class NotificationBase<T> : NotificationBase where T : class, new()
{
protected T This;
public static implicit operator T(NotificationBase<T> thing) { return thing.This; }
public NotificationBase(T thing = null)
{
This = (thing == null) ? new T() : thing;
}
}
谁能给我这段代码的逐行描述?发生了一堆我无法处理的事情。
【问题讨论】: