2

When writing a wpf prism app, I use the ViewModelLocator to automatically create the datacontext when needed. While this works great, there's no intellisense help unless I add a designtime datacontext (d:DataContext="{d:DesignInstance viewModels:MyViewModel}"), but that somewhat defeats the purpose of automatically discovering and connecting the viewmodel.

I image something like this: a resharper plugin that looks for ViewModelLocator.AutowireViewModel="True" in the xaml, fetches the class name, derives the viewmodel type and then tells intellisense to use this type as datacontext.

Question: is it possible for a resharper plugin to tell intellisense what is the type of the datacontext without the designtime datacontext?

Ancillary question: can you give a complete resharper sdk beginner a hint on how to accomplish this?

Haukinger
  • 10,420
  • 2
  • 15
  • 28

1 Answers1

2

Unfortunately, that part of ReSharper is not extensible - it will only work with data set in the file. There is an issue suggesting extending by use of annotations, which is a nice idea - you can vote on it, add details and track: RSRP-385725

citizenmatt
  • 18,085
  • 5
  • 55
  • 60