I have the following functionality given below:
![enter image description here](https://i.stack.imgur.com/xWpop.gif)
单击详细信息时,我希望内容视图上显示的文本应显示在由推送异步创建的新详细信息页面上。如何发送包含内容中给出的信息的参数,例如标题、类别和描述。
我有一个点击手势识别器:
<Label.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/>
</Label.GestureRecognizers>
然后使用后面的代码创建一个新页面:
private async void TapGestureRecognizer_Tapped(object sender, EventArgs e)
{
await Navigation.PushAsync(new DetailsPage(user), true);
}
那么如何绑定包含标题、描述和类别的标签以显示在点击时创建的新页面中呢?
这是标签后面的 xaml 代码:
<StackLayout>
<StackLayout Orientation="Horizontal">
<BoxView Color="LightGray"
WidthRequest="90"
HeightRequest="90"
HorizontalOptions="Center"
VerticalOptions="Center"/>
<StackLayout Padding="0">
<Label x:Name="Title" Text="Title"
FontSize="22"
FontFamily="Grotesk"
TextColor="Black"
Margin="10, -2, 0, 0"
VerticalOptions="Fill" />
<Label x:Name="Category" Text="Category"
FontSize="16"
FontFamily="Grotesk"
TextColor="Gray"
Margin="10, -2, 0, 0"
VerticalOptions="Fill" />
<Label x:Name="Desc" Text="Lorem Ipsum is simply dummy text of the printing and typesetting industry. etc.etc"
Margin="10, -4, 0, 0"
FontSize="15"
FontFamily="Latow"
VerticalOptions="Start"
MaxLines="3"/>
</StackLayout>
</StackLayout>