Find "All References" (Visual Studio)

I am working with VisualStudio 2013. In WPF, C # desktop application.

If I right click on anything, say "WindowTitle" and select "find all links". VS. Shows me a list of all links in C # files (.cs only). If I use edit-find menu on files (all files) VS shows me a list of C # and XAML files (and config, etc.).

For my purposes, I want to see both C # and .xaml when looking for something.

Is this only possible with "find in files"?

I am missing a concept - the way I came to know it is that XAML is used to generate code, so why XAML is not considered a "reference".

+3


source to share


1 answer


If in my XAML I have a named control

<DataGrid x:Name="DGrid"/>

      

Then in my code lock I click Find All References in the DGrid link, Visual Studio shows me the XAML links.



If my XAML has

`Value="{Binding Items}"` 

      

Then in my ViewModel I click Find All References on my Items, Visual Studio won't show me the XAML references because it doesn't know which DataContext the property will be applied to, the type is applied at runtime. It is impossible to know this.

+3


source







All Articles