Hi, How do i remove the toolbaritem when an item in a listview is clicked.
The tabbed page has the following code to display toolbaritems
var contactsPage = new NavigationPage (new ContactsTab () {
Title = "Contacts"
})
{
Title = "Contacts",
Icon="contacts_icon.png",
};
contactsPage.ToolbarItems.Add (new ToolbarItem ("Sign Out", "signout_icon.png", async () => {
await Navigation.PopModalAsync ();
}));
this.Children.Add(contactsPage);
In the ContactsTab page, there is a listview with contacts and when clicked, it navigates to the profile page. But i want to remove the sign out toolbaritem when it navigates and redisplay it when the back button is pressed.
public async void OnListViewItemTapped(object sender, ItemTappedEventArgs e)
{
BasicContact profile = (BasicContact)e.Item;
await Navigation.PushAsync(new ProfilePage (profile));
((ListView)sender).SelectedItem = null;
FreeVariables.fv.isProfileOpen = true;
// Remove ToolbarItem here or remove on Profile page OnAppearing event
}
Any suggestions?