|
<StackLayout x:Name="myStack"
BackgroundColor="Red"
IsVisible="{Binding IsVisible}"
HeightRequest="100"/> |
|
private void ListView_ItemDisappearing(object sender, ItemDisappearingEventArgs e)
{
if((e.ItemData as Contacts).ContactName == "Kyle")
{
//To hide the StackLayout when first item is disappearing.
Device.BeginInvokeOnMainThread(() =>
{
viewModel.IsVisible = false;
});
}
}
private void ListView_ItemAppearing(object sender, ItemAppearingEventArgs e)
{
if ((e.ItemData as Contacts).ContactName == "Kyle")
{
//To show the StackLayout when first item is appearing.
Device.BeginInvokeOnMainThread(() =>
{
viewModel.IsVisible = true;
});
}
} |