C# 如何在Xamarin中获取标签或条目的图像位置
in.xamlC# 如何在Xamarin中获取标签或条目的图像位置,c#,xamarin,C#,Xamarin,in.xaml <Image x:Name="image"> <Image.GestureRecognizers> <TapGestureRecognizer Tapped="GetImageLocationFromExternalCard"/> </Image.GestureRecognizers> </Image> <Label x:Name="fileLocation&quo
<Image x:Name="image">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="GetImageLocationFromExternalCard"/>
</Image.GestureRecognizers>
</Image>
<Label x:Name="fileLocation"/>
我想做的是从存储卡中选取一个图像文件,并将其作为字符串位置发送到标签文本。使用
private void GetImageLocationFromExternalCard(object sender, EventArgs e)
{
// what can i write is here
image.Source = fileLocation.Text;
}
var photo = await MediaPicker.PickPhotoAsync();
image.Source = photo.FullPath;