适用于WPF的Telerik UI应用主题。未找到资源

时间:2017-06-26 18:26:05

标签: c# wpf xaml telerik themes

我在documentation中按照NoXaml + 将XAML文件复制到应用程序中的专用文件夹方法。

我的项目抛出System.Windows.Markup.XamlParseException"找不到MediumBrush。资源名称区分大小写"就在InitializeComponent();行之后。包含的xaml资源文件实际上没有MediumBrush密钥。

当我手动添加<SolidColorBrush x:Key="MediumBrush" Color="Black" />时,它会抛出LowBrush,LayoutControlSplitter_Foreground等。

我在下面引用了dll;

  • Telerik.Windows.Controls
  • Telerik.Windwos.Controls.Data
  • Telerik.Windwos.Controls.DataVisualization
  • Telerik.Windwos.Controls.Input
  • Telerik.Windwos.Controls.Navigation
  • Telerik.Windwos.Data

而且,我添加了xaml主题;

  • System.Windows.xaml
  • Telerik.Windows.Controls.Data.xaml
  • Telerik.Windows.Controls.DataVisualization.xaml
  • Telerik.Windows.Controls.Input.xaml
  • Telerik.Windows.Controls.Navigation.xaml
  • Telerik.Windows.Controls.xaml

当然我注册了xaml资源app App.xaml文件。

抛出的资源键未出现在上面的xaml资源文件中。这些资源实际上在哪里?

注意:针对.Net 4.5项目的WPF版本2017.2.503.45的Telerik UI

2 个答案:

答案 0 :(得分:1)

您还需要添加对实际主题DLL的引用,例如 Telerik.Windows.Themes.Office_Black.dll ,其中包含XAML资源,然后合并您{中所需的XAML文件{1}}:

App.xaml

答案 1 :(得分:0)

这是我的错。我在未定义的MainWindow.xaml中使用了Background={StaticResource MediumBrush}

要解决此问题,请定义名为x:Key="MediumBrush"的自己的SolidColorBrush资源或使用{telerik:Windows8Resource ResourceKey=MediumBrush}

相关问题