나는 Click
처리기 자체 내에서 좋은 방법이 있다고 생각하지 않습니다. 다음 상태 관리하지만 작업 할 수 있습니다
XAML :
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0" Tap="ContentPanel_Tap_1">
<RichTextBox Tap="RichTextBox_Tap_1">
<Paragraph>
fdsfdfdf
<Hyperlink Click="Hyperlink_Click_1">fdsfdsfsaf</Hyperlink>
fsdfsdfa
</Paragraph>
</RichTextBox>
</Grid>
하고 코드 : 둘 다 RichTextBox_Tap_1
에서 RichTextBox
당신이 얻을 것이다 콜백을 클릭하면이 경우
bool RtbTapHandled = false;
private void Hyperlink_Click_1(object sender, RoutedEventArgs e)
{
System.Diagnostics.Debug.WriteLine("Hyperlink");
RtbTapHandled = true;
}
private void RichTextBox_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
{
if (RtbTapHandled)
{
e.Handled = true;
}
RtbTapHandled = false;
System.Diagnostics.Debug.WriteLine("RTB_Tap");
}
private void ContentPanel_Tap_1(object sender, System.Windows.Input.GestureEventArgs e)
{
System.Diagnostics.Debug.WriteLine("Content_Tap");
}
및 ContentPanel_Tap_1
이지만, Hyperlink
을 클릭하면 Hyperlink_Click_1
과 RichTextBox_Tap_1
이 처리되지만 해당 레벨에서 처리되고 중지됩니다.
그래, 꽤 멋지다. 감사! –