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

Why command on button only responds to first canexecute change?

$
0
0

I have the following command:

  TakeOwnershipCommand = new Command(async () =>
   {
                ProcessSessionChanges(await TakeOwnership(LoadedProcedureMetadata.Id));
   },
   () => LoadedProcedureMetadata.owner_id != UserProfile.SessionId 
   );

And a button bound to it:
<Button Text="Own" Command="{Binding SessionState.TakeOwnershipCommand}"/>

When the owner_id changes:
if (e.PropertyName == "owner_id")
{
TakeOwnershipCommand.ChangeCanExecute();
}

What I observe is the Button only makes one transition from enabled to disables and then nothing. I can track the CanExecute running and producing the right result but the Button doesn't change state. If I recreate the page(modal), the state is correct until the next execution.

Any insight would be appreciated. Using v3.2.0.729530-pre2

John


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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