C# 事件绑定不';我不能在ContentPresenter中工作
我想在C# 事件绑定不';我不能在ContentPresenter中工作,c#,wpf,xaml,events,windows-phone-8,C#,Wpf,Xaml,Events,Windows Phone 8,我想在ContentPresenter中使用Interaction.Triggers,但由于某些原因,事件不会被触发。 如果根据ContentControl更改ContentPresenter,则事件绑定将按预期工作 <DataTemplate x:Key="MapPictureTemplate"> <Grid Width="80" Height="80" x:Name="Grid"> <Border
ContentPresenter
中使用Interaction.Triggers
,但由于某些原因,事件不会被触发。
如果根据ContentControl更改ContentPresenter,则事件绑定将按预期工作
<DataTemplate x:Key="MapPictureTemplate">
<Grid Width="80" Height="80" x:Name="Grid">
<Border
Background="{Binding Thumbnail, Converter={StaticResource StreamToImageBrushConverter}}"
CornerRadius="40">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Tap">
<i:InvokeCommandAction Command="{Binding Source={StaticResource Locator}, Path=Main.ImageTappedCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Border>
</Grid>
</DataTemplate>
是-WP有tap活动..你看过这个问题吗?
var content = new ContentPresenter()
{
Content = this,
ContentTemplate = Application.Current.Resources["MapPictureTemplate"] as DataTemplate
};