【发布时间】:2012-07-02 22:57:20
【问题描述】:
我有一个库,其中包含一个 ThemeResources 文件,其中包含样式。
在字体文件夹中,我有一个字体文件 BuxtonSketch.ttf。 Build Action 是 RESOURCE
在 ThemeResources 中,我已经定义了字体:
<FontFamily x:Key="FontFamily-Sketch">pack://application:,,,/Resources/Fonts/#Buxton Sketch</FontFamily>
<Style x:Key="TextNormalStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{StaticResource FontFamily-Sketch}" />
</Style>
由于我的 UserControl 调用了 ProblemUserControl,我调用了但没有工作
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Resources/ThemeResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<TextBlock Text="La pelicula PROMETHEUS!" Style="{StaticResource TextNormalStyle}" />
</Grid>
会发生什么?
【问题讨论】:
-
TextNormalStyle 是在哪里定义的?
-
@ShawnKendrot Ups,我忘记了,但我已经添加了。对不起!
标签: c# wpf silverlight xaml resources