我在数据模板中有一个图像,我想在它获得焦点时调用一个方法,但是 gotfocus 事件没有触发。这是代码:
<DataTemplate>
<Canvas x:Name="cv">
<Image x:Name="img1" Source = "{Binding ModelImage}" Stretch="Fill" Width="432" Height="357" MaxWidth="432" MaxHeight="357"/>
<Image Source = "{Binding HairStyleImage}" Stretch="Fill" ManipulationMode="All" ManipulationDelta="ResourceImage_ManipulationDelta" GotFocus="focussed" LostFocus="lostFocus">
<Image.RenderTransform>
<CompositeTransform />
</Image.RenderTransform>
</Image>
</Canvas>
</DataTemplate>