GestureRecognizers 手势操作触发事件
1 <Label HorizontalTextAlignment="Center"> 2 <Label.FormattedText> 3 <FormattedString> 4 <Span Text="切换用户" TextColor="#2095f1" TextDecorations="Underline"> 5 <Span.GestureRecognizers> <!--手势操作 触发点击事件--> 6 <TapGestureRecognizer Tapped="Change_Tapped" /> 7 </Span.GestureRecognizers> 8 </Span> 9 <Span Text=" | " /> 10 <Span Text="退出登陆" TextColor="#2095f1" TextDecorations="Underline"> 11 <Span.GestureRecognizers> 12 <TapGestureRecognizer Tapped="Exit_Tapped" /> 13 </Span.GestureRecognizers> 14 </Span> 15 </FormattedString> 16 </Label.FormattedText> 17 </Label>