[Solved] { or ; expected error


It appears as though you have some illegal characters in the body of your expression for MyView:

Change:

public DCMViewer MyView { get **=>** myView; set => myView = value; }

To:

public DCMViewer MyView { get => myView; set => myView = value; 

I did a test on the syntax and received the same error while trying to follow the traditional expression body, your issue could just be that you’re not all the way to C# 6 syntax (which I don’t understand since I can use expression bodied methods but not the get accessor). I would recommend automatically implemented properties as below, or go with a more traditional approach if you prefer. Personally, you really have no need to declare bodies for get and set since you aren’t doing anything special with the underlying fields. Thus you can just use an automatically implemented property:

public DCMViewer MyView { get; set; }

3

solved { or ; expected error