2012-09-30 19 views
0

在Windows Presentation Foundation中,我有一個名爲EquipmentList的自定義UIControl。當我在WPF intialize這樣的:'WindowName'不包含'Item'的定義

<EquipmentList:EquipmentListControl Name="equipmentList" Margin="0,0,2,2" /> 

然後我試着像這樣引用它:

InitializeComponent(); 
this.equipmentList.SetReferenceList(referenceDevices); 

我得到的錯誤:

Error 1 'Equipment' does not contain a definition for 'equipmentList' and no extension method 'equipmentList' accepting a first argument of type 'FluentGCS.Windows.Equipment' could be found (are you missing a using directive or an assembly reference?)

ReSharper的沒有顯示錯誤。有什麼問題?

+0

你用錯了標籤的答案。 –

+0

?這是什麼意思? –

+0

Windows基礎演示,它們是不同的標籤,而是使用'WPF'。 –

回答

0

根據OP的請求添加評論作爲回答。

嘗試使用x:Name代替Name看到接受這個SO question

相關問題