[英]How to style TextBox headers with multiple colors in Xaml UWP?
好吧,通过创建以下样式来实现此目的。
<Style x:Key="mandatoryTextBox" TargetType="TextBox">
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock>
<Run Text="{Binding}"></Run><Run Foreground="Red">*</Run>
</TextBlock>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.