Search code examples
imageeventsrichtextboxwindows-phone-7.1tap

image tap fired twice


I have a simple code, with a rich textbox which has an image in it, and the image tap event is fired twice.

How can I fix this?

The code:

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

Thanks in advance


Solution

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