【发布时间】:2017-05-23 19:06:03
【问题描述】:
我一直在使用 Silverlight AutoCompleteBox Introducing the AutoCompleteBox,现在我希望对其应用一些样式,但我似乎无法让它做我想做的事。
我应用的任何样式只会使其不可见而不会出现错误,并且无法调试 XAML。
我只是想应用一些圆角而没有运气。我该怎么做?
这是迄今为止的 XAML,
<Style TargetType="{x:Type controls:AutoCompleteBox}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:AutoCompleteBox}">
<Border Name="border" BorderThickness="0"
Padding="2,2,2,2" CornerRadius="5">
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
【问题讨论】:
-
这是一个带有空边框的 ControlTemplate。显然它没有显示任何内容。
-
@Clemens,我怎么看不到它是空的?
-
它没有显示任何内容的子元素。从这里开始阅读:Customizing the Appearance of an Existing Control by Creating a ControlTemplate。
-
@Clemens,我现在明白了,再次感谢您的帮助。
标签: c# wpf xaml silverlight