简体   繁体   English

更改Silverlight验证摘要中的图标

[英]Change icon in validationsummary in silverlight

I want to change the icon at the top left corner in the validation summary because it's not company compliant. 我要更改验证摘要中左上角的图标,因为它不符合公司要求。

验证摘要图标

Is this possible? 这可能吗? I found nothing on google... 我没有在Google上找到任何东西...

The icon is encoded in the ValidationSummary's HeaderTemplate. 图标编码在ValidationSummary的HeaderTemplate中。 The original template is available here (Search for <Path Fill="#DDD43940" Data="M5.5,2.5 L7.5,2.5 L7.5,8 L5.5,8 M5.5,9.5 L7.5,9.5 L7.5,10.5 L5.5,10.5"/> - this is the exclamation mark). 原始模板在此处可用(搜索<Path Fill="#DDD43940" Data="M5.5,2.5 L7.5,2.5 L7.5,8 L5.5,8 M5.5,9.5 L7.5,9.5 L7.5,10.5 L5.5,10.5"/> -这是感叹号)。

Here's an example of how to customize the header: 这是有关如何自定义标头的示例:

<ctl:ValidationSummary>
  <ctl.ValidationSummary.HeaderTemplate>
    <DataTemplate>
      <Border Background="#FFDC020D">
        <StackPanel Orientation="Horizontal">
          <Image Source="/MyCustomImage.png" />
          <TextBlock Text="{Binding}" Foreground="#FFFFFF" FontWeight="Bold" />
        </StackPanel>
      </Border>
    </DataTemplate>
  </ctl.ValidationSummary.HeaderTemplate>
</ctl:ValidationSummary>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM