2
在我的應用程序的用戶控制我使用的是內容控制,以顯示我的用戶控制獲取點擊甚至在視圖模型
<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>
在上面的代碼什麼,我想實現的,而像我需要在我的視圖模型以觸發相應的事件上輕敲,但通過這段代碼水龍頭事件不點火。但是,當我將交互應用於內容控制時,點擊正在工作。我不能簡單地將點擊事件添加到內容控件,因爲我需要處理兩個以上圖像控件的點擊事件。任何人都可以幫助我解決這個問題。