Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to define a DataTemplate of listboxitem in a ResourceDictionary. when mapping I got error.
class is:
namespace DictMainUI.Model
{
    public class SearchListItem:INotifyPropertyChanged
    {
.............
}}


the Mainwindow 's namespace is DictMainUI, but namespace of my custome class is DictMainUI.Model

in ResourceDictionary, when add the last line it shows error, otherwise it is ok. in whole solution there is only one project, so code is:

<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"
                    >


I saw many articles about mapping, but I could not find solution.

please help me , is there anyone know what to do?
Posted
Updated 22-Mar-12 10:05am
v2

1 solution

looks like the problem is with the project, but I do not know excatly. since I created a whole new project and tried mapping custome class to resourcedictionary and it worked. I don't why , but it worked.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900