Hello
I have a class that inherits fomr contentPage, that contains a ToolbarItem:
if (Device.OS == TargetPlatform.WinPhone)
{
toolbarItem = new ToolbarItem("Add", "add.png", () =>
{
}, 0, 0);
}
ToolbarItems.Add(toolbarItem);
In my OnAppearing and OnDissapearing methods i have:
protected override void OnAppearing()
{
base.OnAppearing();
SetToolbarItems(true);
}
protected override void OnDisappearing()
{
base.OnDisappearing();
SetToolbarItems(false);
}
private void SetToolbarItems(bool show)
{
if (Device.OS != TargetPlatform.WinPhone)
return;
if (show)
{
ToolbarItems.Add(toolbarItem);
}
else
{
ToolbarItems.Remove(toolbarItem);
ToolbarItems.Clear();
}
}
The toolbar items appear when I navigate to this view but when I go back to my mainView (which is a view that also inherits from contentPage) the toolbaritems bar is still there is still showed, How can I hide the toolbar?