When using x:DataType="SomeType" in DataTemplate definition, it breaks Intellisense, so that I don't see properties from SomeType listed when trying to bind inside the DataTemplate. In addition, I'm also getting a warning that such property is not found in SomeType.
On the other hand, when I use x:DataType="{x:Type SomeType}" then I see all properties from SomeType listed when writing a Binding expression inside the DataTemplate. No warnings.
x:DataType to "SomeType"I should see all properties from SomeType listed in Intellisense.
No properties from SomeType listed + I get a warning that given property is not found in SomeType.
x:DataType expects a string literal, not a {x:Type} markup extension
/cc @mgoertz-msft
related to #6492
When I use string literal, it will break Intellisense, as described above.
x:DataType="{x:Type SomeType}" is not supported in Forms Xaml, XamlC compiler should complain about it:
Again guys, I'm okay with using only string literal, but it breaks IntelliSense for me.
What will be done about that?
@viktorszekeress Yes, intellisense should work for string literals. Could you attach small project that demonstrates the issue?
Sorry, it turns out to be only Resharper issue. If I use VS IntelliSense, it does find the properties from SomeType.
@viktorszekeress Can you clarify the status of this issue now? Do you have a solution? Thanks!
@samhouts Hi, yes, after all it turned out to be related to Resharper. Regarding not-accepting {x:Type} expression in XF - I don't think it's a good idea. Why not making language more similar to XAML in WPF, WP8, UWP?
After updating to XF 4.1, my app no longer builds, as I'm not able to use {x:Null} for x:DataType, within a DataTemplate.
Not cool.
See #6648
Sorry, it turns out to be only Resharper issue. If I use VS IntelliSense, it does find the properties from SomeType.
@viktorszekeress
I've turned off Resharper, but VS still does not find the properties.
Is there something else to do in order to make VS intellisense process the type properly ?
@tranb3r
Just make sure that VS IntelliSense is set in R# settings for XAML files. I think I needed to restart VS anyway, then it started working.
@tranb3r
Just make sure that VS IntelliSense is set in R# settings for XAML files. I think I needed to restart VS anyway, then it started working.
Thanks... however, it does not work for me, no matter what I do :(
@tranb3r If the intellisense continues to be an issue for you, please report it via Visual Studio's send feedback. Thanks!
Most helpful comment
@samhouts Hi, yes, after all it turned out to be related to Resharper. Regarding not-accepting {x:Type} expression in XF - I don't think it's a good idea. Why not making language more similar to XAML in WPF, WP8, UWP?