Xamarin.forms MvvmCross MvxAsyncCommand CanExecute不禁用/启用附加按钮

Xamarin.forms MvvmCross MvxAsyncCommand CanExecute不禁用/启用附加按钮,xamarin.forms,mvvmcross,Xamarin.forms,Mvvmcross,我正在Xamarin.Forms解决方案中使用MvvmCross。我用下面的代码将命令附加到按钮上 <Button Text="Login" Command="{Binding LoginCommand}"/> 然后,我查询网络连接何时更改,这反过来会更改MvxAsyncCommand中CanExecute Func中返回的布尔值 { base.OnlineSignalChanged(isOnline

我正在Xamarin.Forms解决方案中使用MvvmCross。我用下面的代码将命令附加到按钮上

 <Button Text="Login" Command="{Binding LoginCommand}"/>
然后,我查询网络连接何时更改,这反过来会更改MvxAsyncCommand中CanExecute Func中返回的布尔值

        {
            base.OnlineSignalChanged(isOnline);
            (LoginCommand as MvxAsyncCommand)?.RaiseCanExecuteChanged();  //tried calling other methods here as well in case I was calling the wrong thing
        }
在最后一个代码块中,我能够停止断点,以查看是否再次查询CanExecute。但是,该按钮未正确启用/禁用

这是MvxAsyncCommand的MvvmCross实现的已知问题吗?最后,我使用了以下线程的建议:使用John Thiriet版本的AsyncCommand,所有这些都可以正常工作


您应该使用
imvxancommand
作为您的命令属性,还应该声明除了命令属性之外的实现,请在上检查此示例。请记住,您可以随时查看以了解如何使用这些功能。@FabriBertani这些编辑没有帮助。我将对ICommand的引用更改为IMvxAsyncCommand。我还将()=>returnisonline函数移到了它自己的方法中。
        {
            base.OnlineSignalChanged(isOnline);
            (LoginCommand as MvxAsyncCommand)?.RaiseCanExecuteChanged();  //tried calling other methods here as well in case I was calling the wrong thing
        }