ReSharper + Silverlight + DataTemplate
So normally in WPF you'd delcare a XAML data template like so:
<DataTemplate x:Key="MyDataTemplate">
<TextBlock Text="{Binding SomeText}" />
</DataTemplate>
And Resharper would complain that it could not find the SomeText property. So you'd add a DataType attribute:
<DataTemplate x:Key="MyDataTemplate" DataType={x:Type MyViewModel}>
<TextBlock Text="{Binding SomeText}" />
</DataTemplate>
and all is well from a code analysis stand point. However, Silverlight lacks the DataTemplate.DataType property so ReSharper doesn't know what to do (aside from barf all over my completely correct data template). Is there a way to make Resharper happy in this scenario? Do I just need to wait Silverlight 5?
Please sign in to leave a comment.
Hello,
Have you tried specifying design-time data context (http://msdn.microsoft.com/en-us/library/ff602277(v=vs.95).aspx)?
Thank you!
Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"