Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Can i use Button's IsEnabled when Command is from a different Context?

$
0
0

Hello,

i have a ContentPage which is defining some Commands. This page is referenced from XAML using the "Source" Binding parameter:

<ContentPage ...
             x:Name="ThisPage">
...
Command="{Binding Source={x:Reference ThisPage}, Path=CancelCommand}"

That works without problems.
I am also binding some values to the object of type "Appointment", which is the context of the ListView i use:
CommandParameter="{Binding APP_ID}"
That part of the code also works without problems.

But now i'm trying to enable/disable some buttons, based on values from their base context (Appointment), while also binding their Command to a page property:

<Button
    Image="hand_thumb_up.png"
    Grid.Row="1"
    Grid.Column="0"
    Command="{Binding Source={x:Reference ThisPage}, Path=CommitCommand}"
    CommandParameter="{Binding APP_ID}"
    IsEnabled="{Binding HaveNotCommitted}"
    />

Everything in that example works - except for the IsEnabled binding.
I've read a lot about how that should work as long as IsEnabled comes after Command - however, that doesn't seem to apply here.
What's the problem? Is there a solution using my approach or do i have to do it in a completely different way?

Thanks in advance.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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