我如何获得智能感知?
我是一名正在学习 WPF 的网页设计师。我需要学习的事情之一是风格。
当我使用 CSS 时,我所要做的就是访问像 w3 这样的网站,看看各种标签支持哪些样式。 WPF 中的示例似乎依赖于智能感知,而不是固定的样式列表。
其他人似乎可以毫无问题地添加
。当他们这样做时,BackgroundHover
由智能感知提供。他们不必寻找它。我的机器上并非如此。由于我找不到已发布的属性列表来设置该样式,所以我被留在了众所周知的小溪中。
如何修复样式的智能感知或找出给定的第三方 UserControl 支持哪些样式?
I'm a web designer learning WPF. One of the things I need to learn are styles.
When I was using CSS all I had to do is go to a site like w3 and see what styles were supported for various tags. The examples from WPF seem to rely on intellisense instead of a fixed list of styles.
Other people seem to be able to add <Setter Property="BackgroundHover" Value="Red">
without an issue. When they do it BackgroundHover
is supplied by intellisense. They don't have to search for it. This is not the case on my machine. Since I can not find a published list of properties to set for the style I'm left up the proverbial creek.
How do I either fix intellisense for styles or find out what styles are supported for a given third party UserControl?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了使智能感知适用于以这种方式设置的属性,它需要知道设置器所应用的类型。因此,在样式中,将
TargetType
设置为您将应用样式的类型,智能感知可以为值提供建议。您还需要确保计算机上的所有内容都具有正确的版本。相同的库、相同版本的 Visual Studio、相同代码等。此外,XAML 文件中不应有任何其他错误。那时智能感知应该可以工作了。
For intellisense to work for properties set that way, it needs to know what type that the setter is being applied to. So in the style, set the
TargetType
to the type that you will be applying the style to and intellisense can offer suggestions to the values.You'll also want to make sure you have the right versions of everything on your machine. The same libraries, same versions of Visual Studio, the same code, etc. Also there should not be any other errors in the XAML file. Intellisense should be working then.
我刚刚在 description of VS 2010 SP1 download:
I just found this in the description of VS 2010 SP1 download: