Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在Xamarin中获取标签或条目的图像位置_C#_Xamarin - Fatal编程技术网

C# 如何在Xamarin中获取标签或条目的图像位置

C# 如何在Xamarin中获取标签或条目的图像位置,c#,xamarin,C#,Xamarin,in.xaml <Image x:Name="image"> <Image.GestureRecognizers> <TapGestureRecognizer Tapped="GetImageLocationFromExternalCard"/> </Image.GestureRecognizers> </Image> <Label x:Name="fileLocation&quo

in.xaml

<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;