在官方Issue Tracker 有人提出这个BUG
http://silverlight.codeplex.com/workitem/7574
主要说了牛人 Jeff Wilcox 提供了解决方案
http://www.jeff.wilcox.name/2011/03/acb-in-pivot/
最好下载:根据代码最好理解了
[ZIP] 31 KB – AutoCompletePivot.zip
http://www.jeff.wilcox.name/wp-content/uploads/2011/03/AutoCompletePivot.zip
代码很多就不仔细说了;
复制Converters/VisibilityConverter.cs 到你的工程
然后 在xaml 里 OK 搞定!~
<
Grid.Resources
>
<
localControls:VisibilityConverter
x:Key
=
"Vis"
/>
</
Grid.Resources
>
<
ControlTemplate
TargetType
=
"toolkit:AutoCompleteBox"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
/>
</
Grid.RowDefinitions
>
<
TextBox
x:Name
=
"Text"
Background
=
"{TemplateBinding Background}"
BorderBrush
=
"{TemplateBinding BorderBrush}"
BorderThickness
=
"{TemplateBinding BorderThickness}"
FontFamily
=
"{TemplateBinding FontFamily}"
FontSize
=
"{TemplateBinding FontSize}"
FontStyle
=
"{TemplateBinding FontStyle}"
FontWeight
=
"{TemplateBinding FontWeight}"
Foreground
=
"{TemplateBinding Foreground}"
InputScope
=
"{TemplateBinding InputScope}"
Opacity
=
"{TemplateBinding Opacity}"
Padding
=
"{TemplateBinding Padding}"
Style
=
"{TemplateBinding TextBoxStyle}"
/>
<
ListBox
Margin
=
"12"
Visibility
=
"{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource Vis}}"
Grid.Row
=
"1"
x:Name
=
"Selector"
Background
=
"White"
FontFamily
=
"{TemplateBinding FontFamily}"
FontSize
=
"{TemplateBinding FontSize}"
FontStyle
=
"{TemplateBinding FontStyle}"
FontWeight
=
"{TemplateBinding FontWeight}"
Foreground
=
"{TemplateBinding Foreground}"
IsTabStop
=
"False"
ItemContainerStyle
=
"{TemplateBinding ItemContainerStyle}"
ItemTemplate
=
"{TemplateBinding ItemTemplate}"
Opacity
=
"{TemplateBinding Opacity}"
BorderBrush
=
"{StaticResource PhoneTextBoxEditBorderBrush}"
BorderThickness
=
"{TemplateBinding BorderThickness}"
Padding
=
"0,8"
/>
</
Grid
>
</
ControlTemplate
>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架