c# - The tag 'ViewModelLocator' does not exist in XML namespace clr-namespace:XXX -
i have tried numerous other solutions without success. have class called viewmodellocator
located in portable class library. has property in called viewmodels
, of type dictionay<k, v>
then have windows phone 8 project references portable class library. added following wp8 app.xaml:
<application x:class="kaizen.wp8.test.app" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:microsoft.phone.controls;assembly=microsoft.phone" xmlns:shell="clr-namespace:microsoft.phone.shell;assembly=microsoft.phone" xmlns:test="clr-namespace:foo.core.portable.viewmodel;assembly=foo.core.portable"> <application.resources> <test:viewmodellocator x:key="viewmodellocator"> <test:viewmodellocator.viewmodels> <test:sampleviewmodel x:key="samplevm"/> </test:viewmodellocator.viewmodels> </test:viewmodellocator> </application.resources> </application>
when press f12 on tags, navigates correct class , or property in pcl. indicates vs knows objects, when try , build, receive following error:
the tag 'viewmodellocator' not exist in xml namespace 'clr-namespace:foo.core.portable.viewmodel;assembly=foo.core.portable'.
the tag 'sampleviewmodel' not exist in xml namespace 'clr-namespace:foo.core.portable.viewmodel;assembly=foo.core.portable'.
could please provide assistance?
[update] reference pcl version of mvvm light in pcl project. how viewmodellocator
class looks like:
public class viewmodellocator { public dynamic this[string viewmodelname] { { if (this.viewmodels.containskey(viewmodelname)) { return this.viewmodels[viewmodelname]; } else { return null; } } } public dictionary<string, viewmodelbase> viewmodels { get; set; } public viewmodellocator() { this.viewmodels = new dictionary<string, viewmodelbase>(); } }
my wp8 project makes use of mvvm light pcl assemblies. noticed that, if make use of viewmodelbase
class dictionary value, when errors. it's there's issue using mvvm light pcl between 2 projects?! [update]
many in advance!! kind regards,
i had problem .net 4.5 project. solution me change .net 4.0, ignore warnings, , change .net 4.5. problem gone.
don't know if feasible way others, worked me.
best regards.
Comments
Post a Comment