Try to move Toolbar Item to the left but same one appears on the right side again

EliasJohannesEliasJohannes ATMember ✭✭

Hey everyone,

I got a problem trying to move a single item in my Toolbar from Right to Left. I made a custom renderer and it does its job:

[assembly: ExportRenderer(typeof(MasterDetailPage), typeof(MyPageRenderer))]
{

    public class MyPageRenderer : TabletMasterDetailRenderer
    {
        bool isLeft = false;

        public override void ViewWillAppear(bool animated)
        {

            if (!isLeft){
                var menuButton = NavigationController.TopViewController.NavigationItem.RightBarButtonItem;
                NavigationController.TopViewController.NavigationItem.LeftBarButtonItem = menuButton;

                isLeft = true;
            }
            NavigationController.TopViewController.NavigationItem.RightBarButtonItem = null;
        }
    }
}

However i got a Click Handler on that toolbar Item to switch between Master & Detail.
ToolbarItem in Xaml:
<ToolbarItem Icon="menu" Activated="Handle_Activated"/>

ToolbarItem Handler:

 void Handle_Activated(object sender, System.EventArgs e)
        {
            this.IsPresented = true;

        }

Whenever the Handler gets triggered the exact same toolbar item appears again on the right side? Maybe i got something wrong with my type of PageRenderers or my assembly?

I Appreciate any help! Thanks in advance!

Sign In or Register to comment.