[ObservableAsProperty]
private extern string Example { get; }
This produces the following warning on VS2015, .NET 4.6.1:
Warning CS0626 Method, operator, or accessor 'ViewModel.Example' is marked external and has no attributes on it. Consider adding a DllImport attribute to specify the external implementation.
On the other hand, this won't produce a warning, but it looks slightly more complicated (and doesn't work at the moment):
private extern string Example
{
[ObservableAsProperty]
get;
}
One solution would be to allow both of the usages. Any other ideas how to solve this, other than suppressing the warning? Contact the Roslyn team?
@ljani thanks! I agree with you that that warning is annoying. You could use private setters instead -- though I like your suggestion of supporting the attribute being inside the getter. I will look into that.
Consider the following example:
This produces the following warning on VS2015, .NET 4.6.1:
On the other hand, this won't produce a warning, but it looks slightly more complicated (and doesn't work at the moment):
One solution would be to allow both of the usages. Any other ideas how to solve this, other than suppressing the warning? Contact the Roslyn team?
Thanks for the plugin!