Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expected 'Value' on type 'Resource' to be an instance member

Since update from Visual Studio 2015 to 2017, I keep getting error for my binding code:

Expected 'value' on type 'Resource' to be an instance member

The program works just fine despite this error. When I rebuild the solution this information is gone until I change the xaml file. Resharper has to 2 solutions for this:

Binding Path=(resources:CaptionResources.WarehouseManagement), Source={StaticResource CaptionResources}

and

<controls:LabeledControl.Caption>
      <Binding Path="WarehouseManagement" Source="{StaticResource CaptionResources}" />
</controls:LabeledControl.Caption>

Is it any Visual Studio 2017 setting, that I miss?

like image 537
Bruniasty Avatar asked Nov 28 '17 21:11

Bruniasty


1 Answers

Probably your WarehouseManagement property is static, so the message: "expected to be an instance member". In this case you have to specify the full path like:

Caption={Binding Path=(namespace:className.WarehouseManagement)}
like image 108
Andrea Cappellari Avatar answered Oct 16 '22 19:10

Andrea Cappellari