Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 事件绑定不';我不能在ContentPresenter中工作_C#_Wpf_Xaml_Events_Windows Phone 8 - Fatal编程技术网

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
};