[英]c# GridViewColumns missing assembly reference
我正在嘗試在Visual Studio 2013,.net 4.5中使用'System.Windows.Controls.GridViewColumn',但是我收到此錯誤消息:
找不到類型“ GridViewColumn”。 驗證您沒有丟失程序集引用,並且所有引用的程序集均已構建。
在我的參考管理器中,我在“程序集”標簽下看到此消息:
所有Framework程序集均已被引用。 請使用對象瀏覽器瀏覽框架中的引用。
當我瀏覽時,找不到“ PresentationFramework.dll”。 這是該類的MSDN: http : //msdn.microsoft.com/zh-cn/library/system.windows.controls.gridviewcolumn(v=vs.110).aspx
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
我嘗試using System.Windows.Controls.GridViewColumn
添加,但是收到此錯誤:
類型或名稱空間名稱
Controls
在名稱空間System.Windows
中不存在(是否缺少程序集引用?)
編輯:
對於WhyCry,當我按照您的建議進行搜索時,仍然沒有任何結果。 也許我需要使用其他的GridView? 也許Windows.UI.Xaml.Controls
?
在創建基於WinRT的 Windows應用商店應用程序時,此GridViewColumn控件是WPF控件之一。
WPF和WinRT是互斥的,您不能在Windows Store應用程序中使用WPF控件。 請閱讀以下內容: Windows 8 Store ApplicationsVs。 WPF應用
好的。 因此,在您的解決方案資源管理器中,右鍵單擊引用 ,然后添加引用 。 然后確保在對話框的左上角突出顯示Framework。 在右上方的搜索欄中搜索PresentationFramework。 添加PresentationFramework。
完成此操作后,請執行以下操作:
using System.Windows.Controls;
然后,您可以隨意訪問所有GridViewColumn
變量,對象。
System.Windows.Controls.Gridview
命名空間:System.Windows.Controls
程序集:PresentationFramework(在PresentationFramework.dll中)
可能需要滾動圖像
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.