j'ai donc ce TextBlock
:WPF texte StringFormat comme DynamicResource
<TextBlock
Text="{Binding Path=Value, ElementName=progressBarColumn, StringFormat={}{0:N2}%}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Foreground="{DynamicResource ProgressBarForegroundColor}"
FontFamily="{DynamicResource ProgressBarFontFamily}"
FontSize="{DynamicResource ProgressBarFontSize}"/>
Et je veux être en mesure de contrôler ce String Format
N2
-N1
etc donc je créé ceci:
<system:String x:Key="ProgressBarStringFormat">N2</system:String>
Utilisation :
Text="{Binding Path=Value, ElementName=progressBarColumn, StringFormat={}{0:ProgressBarStringFormat}%}"
Et dans ma Progress-Bar
au lieu de vu le Value
je ne vois que ProgressBarStringFormat
texte.