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

Binding ToolbarItems

$
0
0

I am attempting to bind a ToolbarItem with:

var aboutItem = new ToolbarItem {Name = "About"};
aboutItem.SetBinding(ToolbarItem.CommandProperty, new Binding("ShowAboutPageCommand"));
ToolbarItems.Add(aboutItem);

The command looks like:

    public ICommand ShowAboutPageCommand
    {
        get
        {
            return new MvxCommand(() => ShowViewModel<AboutViewModel>());
        }
    }

If I for instance bind that command to a button instead it works fine, however nothing happens when I press the item in the ActionBar on Android.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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