I had the same error when adding anything to resources in App.xaml while learning MVVM Light Toolkit. The problem is caused by incorrect dictionary declaration in <Application.Resources> and is not related to MVVM Light Toolkit.
The application resource dictionary should look like:
<Application ...> <Application.Resources> <ResourceDictionary> <vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" /> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Skin1.xaml" /> <ResourceDictionary Source="Skin2.xaml" /> <ResourceDictionary Source="Templates1.xaml" /> <ResourceDictionary Source="Templates2.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application>
Thus, you get a working global resource dictionary with the old Locator key in the same place and new keys from the dictionaries declared in the listed files.
The downloaded files are as follows:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style TargetType="{x:Type Button}"> <Setter Property="Height" Value="28" /> <Setter Property="Padding" Value="12,3" /> </Style> ... </ResourceDictionary>
source share