Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.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
Windows phone 7 在viewmodel中获得用户控件的偶数_Windows Phone 7_Mvvm_Silverlight 4.0_Mvvm Light_Windows Phone 8 - Fatal编程技术网

Windows phone 7 在viewmodel中获得用户控件的偶数

Windows phone 7 在viewmodel中获得用户控件的偶数,windows-phone-7,mvvm,silverlight-4.0,mvvm-light,windows-phone-8,Windows Phone 7,Mvvm,Silverlight 4.0,Mvvm Light,Windows Phone 8,在我的应用程序中,我使用内容控件来显示我的用户控件 <ContentControl Content="{Binding LayoutControl}" Grid.Row="0" Height="700" Width="450"/> 在这里,绑定内容是具有以下元素的用户控件 <Grid x:Name="LayoutRoot" Background="#6C7172"> <Border BorderBrush="White" BorderThickn

在我的应用程序中,我使用内容控件来显示我的用户控件

<ContentControl Content="{Binding LayoutControl}" Grid.Row="0" Height="700" Width="450"/> 

在这里,绑定内容是具有以下元素的用户控件

  <Grid x:Name="LayoutRoot" Background="#6C7172">
    <Border BorderBrush="White" BorderThickness="7">
        <Image Source="{Binding ImagePath0}">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="Tap">
                    <cmd:EventToCommand Command="{Binding Path=ImageTap}" PassEventArgsToCommand="True"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Image>

    </Border>
</Grid>


在上面的代码中,我试图实现的是,在点击图像时,我需要在视图模型中触发相应的事件,但是通过这段代码,点击事件不会触发。但当我将交互性应用于内容控件时,单击就起作用了。我不能简单地将点击事件添加到内容控件,因为在其他一些情况下,我需要处理两个以上图像控件的点击事件。谁能帮我解决这个问题

为图像控件指定一个固定的高度和宽度,然后重试。它会起作用的。如果容器中没有图像,则意味着鼠标将无法获得轻敲的位置。试试这个,如果你仍然面临同样的问题,给我一个反馈