Name cannot be found in the name scope of 'System.Windows.Controls.Button'

后端 未结 2 692
暖寄归人
暖寄归人 2020-12-11 16:04

I have the following Template for my Button


    
        

        
2条回答
  •  鱼传尺愫
    2020-12-11 16:43

    The problem is indeed caused by the ItemsControl which makes the Button and its resources in a different scope.

    A simple fix would be, instead of using Storyboard.TargetName, use Storyboard.Target binding instead, something like this -

    Storyboard.Target="{Binding ElementName=col1}"

提交回复
热议问题