gpt4 book ai didi

c# - 让 XAML 设计器在 VS2010 中显示设计

转载 作者:太空宇宙 更新时间:2023-11-03 11:43:53 26 4
gpt4 key购买 nike

我开始学习 WPF,我捕获了 Family.Show 项目作为真实示例来帮助我学习。它有一个非常好的用户界面,并且在家谱的主面板中有一些很酷的动画——我很想看看他们是怎么做到的。

所以我下载了源代码(http://familyshow.codeplex.com/releases/view/23637#DownloadId=59428),在VS2010 Professional中打开了3.0的解决方案,让它做转换...试过了打开 MainWindow.xaml 然后得到:

Error   1   Undefined CLR namespace. The 'clr-namespace' URI refers to a namespace 'Microsoft.FamilyShow' that is not included in the assembly. C:\Users\nloding\Documents\Visual Studio 2010\Projects\Family.Show-3.0\FamilyShow\MainWindow.xaml   7   15  FamilyShow
Error 2 The type 'local:DiagramViewer' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\nloding\Documents\Visual Studio 2010\Projects\Family.Show-3.0\FamilyShow\MainWindow.xaml 118 12 FamilyShow
Error 3 The type 'local:Details' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\nloding\Documents\Visual Studio 2010\Projects\Family.Show-3.0\FamilyShow\MainWindow.xaml 128 10 FamilyShow
Error 4 The type 'local:NewUserControl' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\nloding\Documents\Visual Studio 2010\Projects\Family.Show-3.0\FamilyShow\MainWindow.xaml 133 8 FamilyShow
Error 5 The type 'local:Welcome' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\nloding\Documents\Visual Studio 2010\Projects\Family.Show-3.0\FamilyShow\MainWindow.xaml 136 8 FamilyShow
Error 6 The type 'local:PersonInfo' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\nloding\Documents\Visual Studio 2010\Projects\Family.Show-3.0\FamilyShow\MainWindow.xaml 139 8 FamilyShow
Error 7 The type 'local:FamilyData' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\nloding\Documents\Visual Studio 2010\Projects\Family.Show-3.0\FamilyShow\MainWindow.xaml 142 8 FamilyShow
Error 8 The type 'local:OldVersionMessage' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. C:\Users\nloding\Documents\Visual Studio 2010\Projects\Family.Show-3.0\FamilyShow\MainWindow.xaml 143 8 FamilyShow

设计器什么也没显示。我已经验证了对 FamilyShowLib 项目的引用存在——我什至构建了 DLL 并将其添加到主项目中。这解决了其他一些小错误,仅此而已。我还必须重新添加对 PresentationCore、PresentationFramework 和 WindowsBase 的引用。现在我只是坚持上面的内容。

因此,我在 Google 上进行了搜索,并找到了有关 VS 中的 XAML 设计器不起作用这一事实的引用资料。这看起来很奇怪,但也许这就是问题所在。

我如何才能让它发挥作用,这样我才能真正学习 WPF?!?!?

最佳答案

我不确定您通过 Google 找到了什么,但 VS 2010 XAML 设计器确实有效。您收到的错误表明您缺少对包含 Microsoft.FamilyShow 命名空间的程序集的引用。

检查您的引用文件夹,确保列出的所有引用旁边都没有黄色感叹号,表示缺少程序集。在尝试查看设计器之前,您可能还需要构建项目。

更新:

我下载了该项目并将其转换为 VS 2010。由于一些构建警告,我不得不手动将 Familylib 项目设置为编译为 .NET 3.0(右键单击该项目,打开属性)。然后项目构建没有错误,我能够在设计器中查看 MainWindow.xaml。

关于c# - 让 XAML 设计器在 VS2010 中显示设计,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3915529/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com