Entwickler-Ecke

WPF / Silverlight - <FontSize> Style nicht möglich?


maho2nd - Di 06.01.09 09:49
Titel: <FontSize> Style nicht möglich?
Hallo,

ohne Probleme bekomme ich folgendes hin:


XML-Daten
1:
2:
3:
4:
5:
<FontFamily x:Key="myFontFamily">Arial</FontFamily>
    
    <Style x:Key="myLabel" TargetType="{x:Type Label}">
        <Setter Property="FontFamily" Value="{DynamicResource myFontFamily}"/>
    </Style>



und kann somit optional die FontFamily zentral festlegen.
Aber wieso kann ich nicht sowas schreiben: ?

XML-Daten
1:
<FontSize x:Key="myFontSize">10</FontSize>                    


Anscheinend scheint es ein <FontSize> nicht zu geben..


maho2nd - Di 06.01.09 16:34

Habs nun selbst hinbekommen.

Folgendes ist die Lösung:


XML-Daten
1:
2:
3:
4:
5:
[...]
xmlns:clr="clr-namespace:System;assembly=mscorlib"
[...]
<clr:Double x:Key="eqFontSize">10</clr:Double>
[...]