dotnet-presentations/dotnet-maui-workshop

RelativeSource ViewModel not found

CiarogSoftware opened this issue · 3 comments

Command="{Binding Source={RelativeSource AncestorType={x:Type viewmodel:MonkeysViewModel}}, Path=GoToDetailsCommand}"

The MonkeysViewModel is not found in the viewmodel namespace when accessing through RelativeSource binding.

Using VS2022 Enterprise 17.3.0 Preview 1.1

image

I think this may be a VS issue though. I created a new minimal project just to test this and it's the same issue. The command works just fine, but the ViewModel doesn't appear in intellisense.

Yes, this looks to be an issue with IntelliSense for some reason. You should be able to continue on. Worth reporting to the team via the top right report a problem.

Sometimes I have seen this issue when debugging basically, but when i stop it is fine.

Intellisense will only suggest view models with a default constructor.

Originally reported in Xamarin in 2019

Logged in MAUI May 2022