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

Binding in custom Toolbar not working

$
0
0

I created a custom toolbarItem to be able to handle visibility after checking out other questions.
I'm doing it based on this resource: https://gist.github.com/JasonEdouardThompson/d000097fa7b1081743e683e43cf7952c

having in my xaml:

<ContentPage.ToolbarItems>
    <views:HideableToolbarItem Icon="reload.png" Text="Reload" Command="{Binding ReloadTapCommand}" IsVisible="true"/>
    <views:HideableToolbarItem Icon="add.png" Text="Add" Command="{Binding AddTapCommand}" IsVisible="{Binding CanAddComment}"/>
</ContentPage.ToolbarItems>

I have the problem that there is something not working with the binding, if I add a breakpoint to CanAddComment it is never reaching the get function in my ViewModel:

    public bool CanAddComment
    {
        get
        {
            return Settings.IsLoggedIn;
        }
    }

if I add an IsEnabled="{Binding CanAddComment}" to the views:HideableToolbarItem I'm reaching the breakpoint. What is wrong with my binding?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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