I have a class which used as DataSource
namespace DictMainUI.Model
{
class SearchListItem:INotifyPropertyChanged
{
private string word;
private int checkamount;
............
public string Word
{
get { return this.word; }
set
{
this.word = value;
OnPropertyChanged(Word);
}
}
public int CheckAmount
{
get { return this.checkamount; }
set
{
if (value < 0)
{
throw new ArgumentException("Price must be positive");
}
this.checkamount = value;
OnPropertyChanged("CheckAmount");
}
}
.............
I want to define a datetemplate for ListboxItem that I want to bind to SearchListItem.
I have a ResourceDictionary, I want to define DataTemplate in this resource.
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
so I think I should add namespace to in order to expose SearchListItem attributes to this ResourceDictionary. but once I add it to the resourcedictionary , building project is failed without any message, and when run it, it shows error it says:set output and assembly name correct or something like that .code shown below (which show error as I said)
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:DictMainUI.Model"
>
it got wrong when I add DictMainUI.Model namespace to the ResourceDictionary.
I did not know why it dose not work,is there anyone give me a advice on that problem?
thanks in advance!