using a converter from another silverlight project
I have silverlight solution that contains three projects
Customs,
Customs.Admin,
Customs.Web
The Customs project has got converter class [ConvertoBool] which is used throught the project for its UI. It is used through a ResourceDictionary tag in a ResourceDictionar开发者_开发问答y.xaml file from the Customs project.
Now Customs being the main project has got a reference to the Customs.Admin project where all the UI for admin screens are present.
If I want to reuse the converter class [ConvertoBool] from the Customs project in my Customs.Admin project, what would be the way to do it?
Thanks for your time...
Converters are just normal classes, so you have to reference the project that contains it. If you cannot reference it because of a circular reference then you'll have to move the Converter and/ore re-think your solution's architecture.
Solved it by adding the following in the app.xaml of Customs project
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="MyResources/Converters.xaml" /> ...
In the Converters.xaml file under folder MyResources of the Customs project I created a resource dictionary pointing to the converter class.
That did it!
精彩评论