False error with DynamicResource & Attached Properties (6.0) Follow
With the latest nightly of R# 6.0 (actually, all the nightlies), I'm seeing false errors in the XAML editor. I'm using VS 2010 targetting .NET 3.5, but I don't know if it also affects .net 4 targets.
The issue is with DynamicResources being set to attached properties. I have a static class without any base (plain old object) that defines an attached dependency property. Then, on a dependency object, I set the value of the attached property to a {DynamicResource... It works just fine but R# flags it as an error. R# 5.1.2 does not.
Please sign in to leave a comment.
Oren,
Could you provide some details on what's highlighted wrong? If you manage to create a simple solution it would be terrific.
I've attached a repro of the bug. Look at the use of the attached property in the Grid element of MainWindow.xaml.
<Grid
r:MyAttachedProperty.FooBar="{DynamicResource foo}"
>
DynamicResource is flagged as an error saying that DynamicResourceExtension can only be used on dependency properties of dependency objects. The attached property is a dependency property being applied to a dependency object and is legal.
Attachment(s):
ReSharperBug.zip
Thanks a lot for the sample. Fixed.
Won't backport to 5.1.x though :(
Thanks. I actually don't recall seeing it in 5.1.x, though I've used all of those nightlies except for the last one (RC)...