2

我想从Silverlight Toolkit自定义ValidationSummary控件的HeaderTemplate显示本地化的 Header。但我不知道如何在标题文本中显示错误计数器...... 有人可以帮我吗?

我当前的 XAML 代码...

<sdk:ValidationSummary Grid.Row="3">
<sdk:ValidationSummary.HeaderTemplate>
    <DataTemplate>
        <Grid Background="Red">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock UseLayoutRounding="False"
                       Foreground="White"
                       Text="Editing Errors:" />
            <TextBlock UseLayoutRounding="True"
                       Foreground="White"
                       FontWeight="Bold"
                       Text="{Binding DisplayedErrors.Count}"
                       Grid.Column="1" />
        </Grid>
    </DataTemplate>
</sdk:ValidationSummary.HeaderTemplate>

提前致谢!

4

2 回答 2

2

Yes, I'm missing only DisplayedErrors.Count! That's the problem!

于 2010-11-22T07:29:26.867 回答
0

从 Text="{Binding DisplayedErrors.Count}" 语句中删除“DisplayedErrors.Count”,仅保留 Text="{Binding}"

于 2010-12-17T07:06:01.373 回答