Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Items Not Showing in Toolbar

$
0
0

I have added 3 items in toolbar with Order=ToolbarItemOrder.Secondary. However I only see 2 of them. I have even tried changing priority on third one but still see only 2 items. Here is my code. Not sure what am I missing-

private void AddToolbarItems(){

        var about=new ToolbarItem {
            Icon = "ic_action_about.png",
            Name = "About",
            Priority = 1,
            Command=new Command(()=>
                {
                    MessagingCenter.Send<NavigateToAboutViewMessage>(new NavigateToAboutViewMessage(),"showaboutview");
                }

            ),
            Order=ToolbarItemOrder.Secondary
        };
        ToolbarItems.Add (about);

        var location=new ToolbarItem {
            Icon = "ic_action_place.png",
            Name = "Location and Hours",
            Priority = 1,
            Command=new Command(()=>
                {
                    MessagingCenter.Send<NavigateToLocationViewMessage>(new NavigateToLocationViewMessage(),"showlocationview");
                }

            ),
            Order=ToolbarItemOrder.Secondary
        };
        ToolbarItems.Add (location);

        var logout=new ToolbarItem {
            Icon = "ic_action_logout.png",
            Name = "Logout",
            Priority = 0,
            Command=new Command(async ()=>
                {
                    App.Logout();
                    await Navigation.PopToRootAsync();
                    MessagingCenter.Send<NotAuthenticatedMessage>(new NotAuthenticatedMessage(),"notauthenticated");
                }

            ),
            Order=ToolbarItemOrder.Secondary
        };
        ToolbarItems.Add (logout);

    }

Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>