我为故事板创建了一个附加的依赖项属性,目的是让我能够在故事板完成事件时调用ViewModel上的方法:
public static class StoryboardExtensions
{
public static ICommand GetCompletedCommand(DependencyObject target)
{
return (ICommand)target.GetValue(CompletedCommandProperty);
}
public static void SetCompletedCommand(Dependenc