我開始學習WPF,我抓住了Family.Show項目作爲一個真實世界的例子來幫助我學習。它有一個相當不錯的用戶界面,並且在家庭主樹的主面板中有一些很酷的動畫 - 我很想看看他們是如何做到的。讓XAML設計師在VS2010中展示設計
所以我下載了源代碼(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?!?!?
沒有Microsoft.FamilyShow的程序集 - 它是XAML文件的代碼隱藏中使用的名稱空間。這就是開始我的困惑,但我從來沒有打過「建造」......在我做到這一點之後,它工作得很好。很有意思。 – 2010-10-12 14:32:49
在Familylib項目/程序集中定義了Microsoft.FamilyShow命名空間。直到你建立,程序集才存在,因此錯誤。 – 2010-10-12 14:46:42