无法在 Blend 中显示 AutoCompleteBox
我遇到了 Autocompletebox 控件的问题,该控件在 Blend 中不起作用,它抱怨 InputScope 属性的 TypeConverter 无法从字符串进行转换。该控件在运行时工作正常,并且在 VS2010 设计器中显示良好。
有没有一种简单的方法可以完全禁用该控件或仅在设计时将其替换为简单的文本块?
更好的是有人知道我如何让 AutoCompleteBox 按原样在混合中工作吗?
编辑: 我发现,如果我只删除 InputScope 属性的设置,则 AutoCompleteBox 显示正常。那么,在设计模式下,如何以编程方式删除 XAML (InputScope="Search") 的那部分呢?
I have a problem with the Autocompletebox control which doesn't work in Blend which complains that the TypeConverter for the InputScope property cannot convert from a string. The control works fine at run time and displays fine in the VS2010 designer.
Is there an easy way can either just disable the control entirely or swap it out for a simple textblock at design time only?
Better still does anyone know how I could just make the AutoCompleteBox work in blend as is?
Edit:
I've found that if I just remove the setting of the InputScope property then the AutoCompleteBox displayes fine. So how can I programaticly remove just that portion of the XAML (InputScope="Search") when in design mode?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这很奇怪,在我为这个控件创建了默认样式后,它不再向我抛出任何错误......而且我不知道为什么......我认为这是一个错误。 :)
It's weird, after I created a default style for this control, it doesn't throw me any error anymore... And I have no idea why... I think it is a bug. :)
事实证明这非常简单。
只需在要忽略的属性中添加 mc:Ignorable 前缀即可。
http://msdn.microsoft.com/en-us/library/aa350024.aspx
换句话说,只需在 InputScope 属性前加上 d 前缀即可:
Turns out it is incredibly easy.
Just add the mc:Ignorable prefix to the attribute to be ignored.
http://msdn.microsoft.com/en-us/library/aa350024.aspx
In other words just prefix the InputScope attribute with d: