michielpost.nl

MVVM Light: Cannot create an instance of "ViewModelLocator" on Windows 8

09-07-2012

When you create a new Windows 8 Metro style application and install MVVM Light using NuGet (full install), it will create a ViewModelLocator class in the ViewModel folder.

After you've modified your MainPage's datacontext to the new MainViewModel using this line:
DataContext="{Binding Source={StaticResource Locator}, Path=Main}"

Loading your view in the designer returns this error:
Cannot create an instance of "ViewModelLocator"

It looks like the included file for the ViewModelLocator in the NuGet package contains an error.

Quick fix:
Make sure your ViewModelLocator constructor is static:
/// <summary>
/// Initializes a new instance of the ViewModelLocator class.
/// </summary>
static ViewModelLocator()
{

}

Comments


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=9f2bf6b4c874b69e244499121e1516c5& 19-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. https://helloworld.com?h=9f2bf6b4c874b69e244499121e1516c5&


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=9f2bf6b4c874b69e244499121e1516c5& 19-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=9f2bf6b4c874b69e244499121e1516c5&


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=9f2bf6b4c874b69e244499121e1516c5& 20-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=9f2bf6b4c874b69e244499121e1516c5&


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=9f2bf6b4c874b69e244499121e1516c5& 20-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=9f2bf6b4c874b69e244499121e1516c5&


???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=9f2bf6b4c874b69e244499121e1516c5& 21-11-2020
???????? ?? ? ????, ????? ???????? ??????, ? ? ????, ????? ???? ????? ????? ?????. http://bit.do/fLc9r?h=9f2bf6b4c874b69e244499121e1516c5&


Buy legal anabolic steroids https://myfsk.org/community/account/buy-legal-anabolic-steroids/?h=9f2bf6b4c874b69e244499121e1516c5& 13-12-2020
Buy legal anabolic steroids https://myfsk.org/community/account/buy-legal-anabolic-steroids/?h=9f2bf6b4c874b69e244499121e1516c5&


Buy legal anabolic steroids https://myfsk.org/community/account/buy-legal-anabolic-steroids/?h=9f2bf6b4c874b69e244499121e1516c5& 13-12-2020
Buy legal anabolic steroids https://myfsk.org/community/account/buy-legal-anabolic-steroids/?h=9f2bf6b4c874b69e244499121e1516c5&


<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=9f2bf6b4c874b69e244499121e1516c5& 20-12-2020
<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=9f2bf6b4c874b69e244499121e1516c5&


<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=9f2bf6b4c874b69e244499121e1516c5& 21-12-2020
<p><a href="https://f3gxp.page.link/Tbeh"><img src="https://i.ibb.co/rH6Ky7F/best-hookup-sites-fs.jpg"></a></p>?h=9f2bf6b4c874b69e244499121e1516c5&


GgdJV 10-01-2021
Drugs information for patients. Generic Name. <a href="https://prednisone4u.top">can i buy prednisone without rx</a> in the USA. Some information about drugs. Read here. <a href=http://psoevalencina.org/blog/agrupacion-socialista-de-valencina-de-la-concepcion/el-sr-ppena-vuelve-a-mentir-a-valencina-esta-vez-sobre-los-terrenos-del-cerro-de-la-cabeza_aa149.html?send=ok#viewcomment>Some about pills.</a> <a href=http://g-bookmark.com/1331258740.htm>All information about medicines.</a> <a href=https://ru.vaskar.co.in/translate/1?to=en&from=ru&source=Drug%20information%20sheet.%20What%20side%20effects%20can%20this%20medication%20cause%3F%20%3Ca%20href%3D%22https%3A%2F%2Fviagra4u.top%22%3Ecan%20i%20get%20viagra%20pill%3C%2Fa%3E%20in%20Canada.%20Everything%20news%20about%20drugs.%20Get%20information%20here.%20%0D%0A%3Ca%20href%3Dhttps%3A%2F%2Famp.en.vaskar.co.in%2Ftranslate%2F1%3Fto%3Dru%26from%3Den%26source%3DMedicine%2520information%2520sheet.%2520Drug%2520Class.%2520%253Ca%2520href%253D%2522https%253A%252F%252Fviagra4u.top%2522%253Eget%2520generic%2520viagra%2520no%2520prescription%253C%252Fa%253E%2520in%2520the%2520USA.%2520Best%2520information%2520about%2520medicament.%2520Get%2520here.%2520%250D%250A%253Ca%2520href%253Dhttp%253A%252F%252Fbpo.gov.mn%252Fcontent%252F185%253EEverything%2520news%2520about%2520drug.%253C%252Fa%253E%2520%253Ca%2520href%253Dhttps%253A%252F%252F925.ua%252Fpodvesf-18%253EBest%2520trends%2520of%2520medication.%253C%252Fa%253E%2520%253Ca%2520href%253Dhttp%253A%252F%252Feidsvoll-dk.no%252Fedk-forum%252Ftopic%252Ffixed-matches-tips-ht-ft-professional-apk%252F%2523post-346241%253ESome%2520about%2520drug.%253C%252Fa%253E%2520%2520f6fcf11%2520%26result%3D%25D0%2598%25D0%25BD%25D1%2584%25D0%25BE%25D1%2580%25D0%25BC%25D0%25B0%25D1%2586%25D0%25B8%25D0%25BE%25D0%25BD%25D0%25BD%25D1%258B%25D0%25B9%2520%25D0%25BB%25D0%25B8%25D1%2581%25D1%2582%25D0%25BE%25D0%25BA%2520%25D0%25BF%25D0%25BE%2520%25D0%25BC%25D0%25B5%25D0%25B4%25D0%25B8%25D1%2586%25D0%25B8%25D0%25BD%25D0%25B5.%2520%25D0%259A%25D0%25BB%25D0%25B0%25D1%2581%25D1%2581%2520%25D0%259D%25D0%25B0%25D1%2580%25D0%25BA%25D0%25BE%25D1%2582%25D0%25B8%25D0%25BA%25D0%25BE%25D0%25B2.%2520%253Ca%2520href%253D%2522https%253A%252F%252Fviagra4u.top%2522%2520%253E%2520%25D0%25BF%25D0%25BE%25D0%25BB%25D1%2583%25D1%2587%25D0%25B8%25D1%2582%25D1%258C%2520%25D0%25B4%25D0%25B6%25D0%25B5%25D0%25BD%25D0%25B5%25D1%2580%25D0%25B8%25D0%25BA%2520%25D0%2592%25D0%25B8%25D0%25B0%25D0%25B3%25D1%2580%25D1%258B%2520%25D0%25B1%25D0%25B5%25D0%25B7%2520%25D1%2580%25D0%25B5%25D1%2586%25D0%25B5%25D0%25BF%25D1%2582%25D0%25B0%253C%252Fa%253E%2520%25D0%25B2%2520%25D0%25A1%25D0%25A8%25D0%2590.%2520%25D0%259B%25D1%2583%25D1%2587%25D1%2588%25D0%25B0%25D1%258F%2520%25D0%25B8%25D0%25BD%25D1%2584%25D0%25BE%25D1%2580%25D0%25BC%25D0%25B0%25D1%2586%25D0%25B8%25D1%258F%2520%25D0%25BE%2520%25D0%25BB%25D0%25B5%25D0%25BA%25D0%25B0%25D1%2580%25D1%2581%25D1%2582%25D0%25B2%25D0%25B5%25D0%25BD%25D0%25BD%25D0%25BE%25D0%25BC%2520%25D1%2581%25D1%2580%25D0%25B5%25D0%25B4%25D1%2581%25D1%2582%25D0%25B2%25D0%25B5.%2520%25D0%2598%25D0%25B4%25D0%25B8%2520%25D1%2581%25D1%258E%25D0%25B4%25D0%25B0.%2520%253Ca%2520href%253Dhttp%253A%252F%252Fbpo.gov.mn%2520%252F%2520content%2520%252F%2520185%253E%25D0%25B2%25D1%2581%25D0%25B5%2520%25D0%25BD%25D0%25BE%25D0%25B2%25D0%25BE%25D1%2581%25D1%2582%25D0%25B8%2520%25D0%25BE%2520%25D0%25BD%25D0%25B0%25D1%2580%25D0%25BA%25D0%25BE%25D1%2582%25D0%25B8%25D0%25BA%25D0%25B0%25D1%2585.%253C%2520%252F%2520a%253E%2520%253Ca%2520href%253Dhttps%253A%252F%2520%252F%2520925.ua%2520%252F%2520podvesf-18%253E%25D0%25BB%25D1%2583%25D1%2587%25D1%2588%25D0%25B8%25D0%25B5%2520%25D1%2582%25D0%25B5%25D0%25BD%25D0%25B4%25D0%25B5%25D0%25BD%25D1%2586%25D0%25B8%25D0%25B8%2520%25D0%25BC%25D0%25B5%25D0%25B4%25D0%25B8%25D0%25BA%25D0%25B0%25D0%25BC%25D0%25B5%25D0%25BD%25D1%2582%25D0%25BE%25D0%25B7%25D0%25BD%25D0%25BE%25D0%25B3%25D0%25BE%2520%25D0%25BB%25D0%25B5%25D1%2587%25D0%25B5%25D0%25BD%25D0%25B8%25D1%258F.%253C%2520%252F%2520a%253E%2520%253Ca%2520href%253Dhttp%253A%252F%252Feidsvoll-dk.no%252Fedk-forum%252Ftopic%2520%252F%2520fixed-matches-tips-ht-ft-professional-apk%2520%252F%2520%2523post-346241%253E%25D0%25BD%25D0%25B5%25D0%25BC%25D0%25BD%25D0%25BE%25D0%25B3%25D0%25BE%2520%25D0%25BE%2520%25D0%25BD%25D0%25B0%25D1%2580%25D0%25BA%25D0%25BE%25D1%2582%25D0%25B8%25D0%25BA%25D0%25B0%25D1%2585.%253C%2520%252F%2520a%253E%2520f6fcf11%3EActual%20trends%20of%20meds.%3C%2Fa%3E%20%3Ca%20href%3Dhttps%3A%2F%2Fdinhduongnet.com%2Fsan-pham%2Fsua-appeton-weight-gain-vi-so-co-la-900g-sua-cho-nguoi-gay%2F%23comment-67465%3ESome%20trends%20of%20drug.%3C%2Fa%3E%20%3Ca%20href%3Dhttps%3A%2F%2Fgoodlife.fuelthemes.net%2Ffashion%2Fkate-hudson-stripped-down-to-nothing-but-her-bra-and-underwear-on-instagram-on-tuesday-adding-to-the-many-hot-female-selfies%2F%23comment-84131%3EBest%20information%20about%20medicament.%3C%2Fa%3E%20%20216f828%20&result=Drug%20information%20sheet.%20What%20side%20effects%20can%20this%20medication%20cause%3F%20%3Ca%20href%3D%22https%3A%2F%2Fviagra4u.top%22%3Ecan%20i%20get%20viagra%20pill%3C%2Fa%3E%20in%20Canada.%20Everything%20news%20about%20drugs.%20Get%20information%20here.%20%3Ca%20href%3Dhttps%3A%2F%2Famp.en.vaskar.co.in%2Ftranslate%2F1%3Fto%3Dru%26from%3Den%26source%3DMedicine%20information%20sheet.%20Drug%20Class.%20%3Ca%20href%3D%22https%3A%2F%2Fviagra4u.top%22%3Eget%20generic%20viagra%20no%20prescription%3C%2Fa%3E%20in%20the%20USA.%20Best%20information%20about%20medicament.%20Get%20here.%20%0D%0A%3Ca%20href%3Dhttp%3A%2F%2Fbpo.gov.mn%2Fcontent%2F185%3EEverything%20news%20about%20drug.%3C%2Fa%3E%20%3Ca%20href%3Dhttps%3A%2F%2F925.ua%2Fpodvesf-18%3EBest%20trends%20of%20medication.%3C%2Fa%3E%20%3Ca%20href%3Dhttp%3A%2F%2Feidsvoll-dk.no%2Fedk-forum%2Ftopic%2Ffixed-matches-tips-ht-ft-professional-apk%2F%23post-346241%3ESome%20about%20drug.%3C%2Fa%3E%20%20f6fcf11%20%26result%3D%D0%98%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%86%D0%B8%D0%BE%D0%BD%D0%BD%D1%8B%D0%B9%20%D0%BB%D0%B8%D1%81%D1%82%D0%BE%D0%BA%20%D0%BF%D0%BE%20%D0%BC%D0%B5%D0%B4%D0%B8%D1%86%D0%B8%D0%BD%D0%B5.%20%D0%9A%D0%BB%D0%B0%D1%81%D1%81%20%D0%9D%D0%B0%D1%80%D0%BA%D0%BE%D1%82%D0%B8%D0%BA%D0%BE%D0%B2.%20%3Ca%20href%3D%22https%3A%2F%2Fviagra4u.top%22%20%3E%20%D0%BF%D0%BE%D0%BB%D1%83%D1%87%D0%B8%D1%82%D1%8C%20%D0%B4%D0%B6%D0%B5%D0%BD%D0%B5%D1%80%D0%B8%D0%BA%20%D0%92%D0%B8%D0%B0%D0%B3%D1%80%D1%8B%20%D0%B1%D0%B5%D0%B7%20%D1%80%D0%B5%D1%86%D0%B5%D0%BF%D1%82%D0%B0%3C%2Fa%3E%20%D0%B2%20%D0%A1%D0%A8%D0%90.%20%D0%9B%D1%83%D1%87%D1%88%D0%B0%D1%8F%20%D0%B8%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%86%D0%B8%D1%8F%20%D0%BE%20%D0%BB%D0%B5%D0%BA%D0%B0%D1%80%D1%81%D1%82%D0%B2%D0%B5%D0%BD%D0%BD%D0%BE%D0%BC%20%D1%81%D1%80%D0%B5%D0%B4%D1%81%D1%82%D0%B2%D0%B5.%20%D0%98%D0%B4%D0%B8%20%D1%81%D1%8E%D0%B4%D0%B0.%20%3Ca%20href%3Dhttp%3A%2F%2Fbpo.gov.mn%20%2F%20content%20%2F%20185%3E%D0%B2%D1%81%D0%B5%20%D0%BD%D0%BE%D0%B2%D0%BE%D1%81%D1%82%D0%B8%20%D0%BE%20%D0%BD%D0%B0%D1%80%D0%BA%D0%BE%D1%82%D0%B8%D0%BA%D0%B0%D1%85.%3C%20%2F%20a%3E%20%3Ca%20href%3Dhttps%3A%2F%20%2F%20925.ua%20%2F%20podvesf-18%3E%D0%BB%D1%83%D1%87%D1%88%D0%B8%D0%B5%20%D1%82%D0%B5%D0%BD%D0%B4%D0%B5%D0%BD%D1%86%D0%B8%D0%B8%20%D0%BC%D0%B5%D0%B4%D0%B8%D0%BA%D0%B0%D0%BC%D0%B5%D0%BD%D1%82%D0%BE%D0%B7%D0%BD%D0%BE%D0%B3%D0%BE%20%D0%BB%D0%B5%D1%87%D0%B5%D0%BD%D0%B8%D1%8F.%3C%20%2F%20a%3E%20%3Ca%20href%3Dhttp%3A%2F%2Feidsvoll-dk.no%2Fedk-forum%2Ftopic%20%2F%20fixed-matches-tips-ht-ft-professional-apk%20%2F%20%23post-346241%3E%D0%BD%D0%B5%D0%BC%D0%BD%D0%BE%D0%B3%D0%BE%20%D0%BE%20%D0%BD%D0%B0%D1%80%D0%BA%D0%BE%D1%82%D0%B8%D0%BA%D0%B0%D1%85.%3C%20%2F%20a%3E%20f6fcf11%3EActual%20trends%20of%20meds.%3C%2Fa%3E%20%3Ca%20href%3Dhttps%3A%2F%2Fdinhduongnet.com%2Fsan-pham%2Fsua-appeton-weight-gain-vi-so-co-la-900g-sua-cho-nguoi-gay%2F%23comment-67465%3ESome%20trends%20of%20drug.%3C%2Fa%3E%20%3Ca%20href%3Dhttps%3A%2F%2Fgoodlife.fuelthemes.net%2Ffashion%2Fkate-hudson-stripped-down-to-nothing-but-her-bra-and-underwear-on-instagram-on-tuesday-adding-to-the-many-hot-female-selfies%2F%23comment-84131%3EBest%20information%20about%20medicament.%3C%2Fa%3E%20216f828>Some news about pills.</a> bcdc84b


New Comment

Name
E-mail (not published)
Comment
Enter the code shown: