2012-02-28 56 views
0

我有一個簡單的代碼,其中包含一個圖像的豐富文本框,並且圖像點擊事件被觸發兩次。圖像點擊發射兩次

我該如何解決這個問題?

代碼:

<RichTextBox> 
     <Paragraph> 
      <InlineUIContainer> 
       <Image Source="/PhoneApp1;component/someimage.jpg" tap="image_OnTap" /> 
      </InlineUIContainer> 
     </Paragraph> 
    </RichTextBox> 

在此先感謝

回答

1
static void image_OnTap(object sender, System.Windows.Input.GestureEventArgs e) 
{ 
    e.Handled = true; // <- The mark has completed the process, 
    MessageBox.Show ("ok"); 
}