2013-10-05 41 views
0

我試圖測試此Animation Timeline ClassMSDN網站,但有問題獲取正確的引用加載。我目前的目標是.NET 4.5System.Windows之後的所有內容都會導致錯誤,說明最後5箇中沒有一個存在於System.Windows中。但是,當我檢查參考文獻列表/嘗試添加它們時,其中沒有一個(除System.Windows)被列出。不能使用Windows參考

using System; 
using System.Windows; 
using System.Windows.Navigation; <--- From here down, none exist 
using System.Windows.Media; 
using System.Windows.Media.Animation; 
using System.Windows.Shapes; 
using System.Windows.Controls; 

有沒有辦法讓的Visual Studio認出來?

+0

您是否嘗試添加對它們的引用 – 2013-10-05 23:50:40

+0

@PreciousTijesunimi我試過了,但除System.Windows以外,其餘的不會顯示在列表中以添加它們。 – SpicyWeenie

+0

你有沒有試過瀏覽到實際的dll。如果它不在GAC中,它不會顯示在列表中 –

回答

2

AnimationTimeline類是Windows Presentation Foundation(WPF)的一部分。我懷疑你的項目是作爲Windows Forms應用程序創建的。這些技術是非常不同的,通常你不要把它們混合在一起,除非特殊情況。

如果你看同樣的MSDN頁您聯繫我們,你會看到它的定義如下所示:

大會:PresentationCore(在PresentationCore.dll中)

因此,爲了使用該類,您必須添加對PresentationCore.dll的引用。至少爲了核心的WPF功能,您通常還需要引用PresentationFramework.dll和WindowsBase.dll。

如果您只是在Visual Studio中創建一個新的WPF應用程序,它應該有適當的引用。