如何将此C#6.0代码转换为C#4.0?
public void Subscribe(string message, Action<IMessagingService> callback) =>
MessagingCenter.Subscribe<MessagingService>(this, message, callback);
或
public object ConvertBack(object value, Type targetType, object parameter,
CultureInfo culture) => null;
我可以简单地创建get属性吗?
答案 0 :(得分:5)
你所展示的这种表达方式只是C#6的简写:
public void Subscribe(string message, Action<IMessagingService> callback)
{
MessagingCenter.Subscribe<MessagingService>(this, message, callback);
}