IsDataSource property not found in type 'ViewModelLocator

I have the following code:

<UserControl x:Class="TestApp.View.ViewAlarmLog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:Custom="http://schemas.microsoft.com/wpf/2008/toolkit" xmlns:mvvm="clr-namespace:Test.ViewModel"> <UserControl.Resources> <ResourceDictionary > <ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries> <mvvm:ViewModelLocator x:Key="Locator" d:IsDataSource="True"/> </ResourceDictionary> </UserControl.Resources> 

the problem is that I always get the error message: The IsDataSource property was not found in the type "ViewModelLocator". "

What could be the problem?

Redgards Dieter

+7
mvvm expression-blend
source share
1 answer

I think the IsDataSource attribute is specific to Expression Blend. Other editors such as Visual Studio will not be able to understand this.

You can fix this problem by telling the editor to ignore this attribute.

Try adding the following attributes to the UserControl element:

 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" 
+14
source share

All Articles