質問

I have this simple piece of code and I am wondering how to convert it to German format (#.###,##) ?

// displays #.##
<Label Content="{Binding MySumValue}"/>
役に立ちましたか?

解決

Try set the ContentStringFormat for Label or just StringFormat for TextBlock with necessary xml:lang.

Example:

<Grid>
    <Button Name="MyButton" 
            Content="OK" 
            Width="100,999" 
            Height="25" />

    <Label Name="MyLabel"                
           Content="{Binding Path=Width, ElementName=MyButton}"
           xml:lang="de-DE"
           ContentStringFormat="{}{0:N2}" /> 
</Grid>

Output

enter image description here

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top