我有自己的形状类
public sealed class MirrorTile : Shape
在这个类中,我添加了事件。
public static readonly RoutedEvent SelectedEnterEvent = EventManager.RegisterRoutedEvent("SelectedEnter", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MirrorTile));
public event RoutedEventHandler SelectedEnter
{
add
{
this.AddHandler(SelectedEnterEvent, value);
}
remove
{
this.RemoveHandler(SelectedEnterEvent, value);
}
}
并希望以这种方式使用它
<shapes:MirrorTile>
<shapes:MirrorTile.Triggers>
<EventTrigger RoutedEvent="SelectedEnter">
<BeginStoryboard Storyboard="{StaticResource SelectShape}"/>
</EventTrigger>
</shapes:MirrorTile.Triggers>
</shapes:MirrorTile>
启动后我遇到了异常:
{"RoutedEventConverter 无法从 System.String 进行转换。"}
我做错了什么,如何解决这个问题?
namespace:ClassName.EventName
- McGarnagle