Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid value for 'Event'-Property (XAML Eventsetter)

Tags:

c#

wpf

xaml

I'm using Visual Studio 2015 Community and I get the following error message:

Invalid value for 'Event'-Property: Microsoft.VisualStudio.DesignTools.Xaml.LanguageService.Semantics.XmlValue.

Here's the code behind:

<Style x:Key="TextBoxStyle1" BasedOn="{x:Null}" TargetType="{x:Type TextBox}">
    <EventSetter Event="MouseEnter" Handler="Check_MouseEnter" />
    <EventSetter Event="MouseLeave" Handler="Check_MouseLeave" />
    <EventSetter Event="GotFocus" Handler="Check_GotFocus" />

I've tried UIElement.MouseEnter, Mouse.MouseEnter, TextBox.MouseEnter. If I compile the handler works just fine, but the error message is still there.

Any suggestions?

like image 976
Joel Avatar asked Jul 13 '15 08:07

Joel


1 Answers

This seems a bug in the WPF designer, as already reported here on Microsoft Connect.

It seems that the designer falsely gives an warning or error, but eventually the code is okay, so it compiles and works. Nothing you should worry about now, since the product isn't released yet.

like image 80
Patrick Hofman Avatar answered Nov 08 '22 07:11

Patrick Hofman