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

ToolbarItems show up on Android but not on Windows Phone

$
0
0

I have the following code snippet for adding items to the toolbar. The item shows up for Android, but not for Windows Phone. What am I missing?

            Title = "Create Account";
            ToolbarItems.Clear();
            if (Device.OS == TargetPlatform.WinPhone)
            {                
                ToolbarItems.Add(new ToolbarItem
                {
                    Name = "Cancel",
                    Icon = "Toolkit.Content/ApplicationBar.Cancel.png",
                    Command = new Command(() => Navigation.PopAsync()),
                });
            }
            if (Device.OS == TargetPlatform.Android)
            {
                ToolbarItems.Add(new ToolbarItem
                {
                    Name = "Cancel",
                    Command = new Command(() => Navigation.PopAsync()),
                });
            }
            Content = infoPane;

Viewing all articles
Browse latest Browse all 58056

Trending Articles



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