我的XAML是這樣的:XAML看不到類
<DataGrid.Resources>
<Helpers:EnumHelper x:Key="EnumHelper" />
</DataGrid.Resources>
我的類的定義是這樣的:
namespace MyProj.View.UserControlHelpers {
public class EnumHelper { }
}
我得到的錯誤是這樣的:
命名空間「clr-namespace:MyProj.View.UserControlHelpers」中不存在名稱「EnumHelper」。
我已經從工作室清理了這個項目,然後我刪除了bin和obj子目錄中的每個文件,我甚至改變了類名,仍然沒有成功 - 我仍然得到這個錯誤。
編輯:
我的XAML頭是LIK此:
<UserControl x:Class="MyProj.View.Partials.TableWindow.Columns"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:cmd="http://www.galasoft.ch/mvvmlight"
xmlns:Helpers="clr-namespace:MyProj.View.UserControlHelpers"
xmlns:Model="clr-namespace:MyProj.Model"
xmlns:ModelHelpers="clr-namespace:MyProj.Model.Helpers"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
展xmlns attr – Athari 2014-09-06 19:36:59
我這樣做不明白。你想要我做什麼? – 2014-09-06 19:38:11
使用描述XML名稱空間和導入的CLR名稱空間的所有屬性顯示您的XAML頭。 – Athari 2014-09-06 19:39:06