【发布时间】:2025-12-21 12:15:12
【问题描述】:
这可能是一个愚蠢的问题,但我找不到答案......
我刚刚开始使用 WPF,并正在尝试将 ResourceDictionary 添加到我的项目中。
这里是这个:
https://monotone.codeplex.com/
所以我下载了 zip 文件,并将其解压缩到:
MyProjectDir/MonoTone
我已将以下内容添加到我的App.xaml
<Application x:Class="TestWPF.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:TestWPF"
xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Monotone/Monotone.Colors.xaml" />
<ResourceDictionary Source="Monotone/Monotone.Brushes.xaml" />
<ResourceDictionary Source="Monotone/Monotone.MahApps.xaml" />
<ResourceDictionary Source="Monotone/Monotone.xaml" />
<ResourceDictionary Source="Monotone/Monotone.ExtendedWPFToolkit.xaml" />
<ResourceDictionary Source="Monotone/Monotone.ColorBox.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
在这里:
https://monotone.codeplex.com/wikipage?title=Installing%20Monotone&referringTitle=Documentation
现在 Intelsense 在 xaml 路径下划线,并且找不到文件。
我添加了对 dll 的引用。我错过了什么?
谢谢。
【问题讨论】:
-
你能分享整个
App.xaml吗? -
您是否确实将 xaml 文件添加到项目中(它们是否在解决方案资源管理器窗口中可见)?仅将它们提取到目录是不够的。