Meh*_*met 5 command button mvvm mvvmcross xamarin.forms
我使用 Xamarin.Forms 和 MvvmCross,但我在应用程序中遇到了问题。触摸并运行命令后,按钮有时会被禁用。
我在按钮上添加了 IsEnabled="True" 但没有任何改变
<Button
WidthRequest="36"
HeightRequest="36"
CornerRadius="18"
BorderWidth="2"
FontSize="18"
Text="{Binding OptionText}"
Command="{Binding OptionSelectedCommand}"
CommandParameter="{Binding .}"
IsEnabled="True"
VerticalOptions="Center"
HorizontalOptions="Center"/>
Run Code Online (Sandbox Code Playgroud)
我希望始终启用此按钮。
我的命令代码是:
<Button
WidthRequest="36"
HeightRequest="36"
CornerRadius="18"
BorderWidth="2"
FontSize="18"
Text="{Binding OptionText}"
Command="{Binding OptionSelectedCommand}"
CommandParameter="{Binding .}"
IsEnabled="True"
VerticalOptions="Center"
HorizontalOptions="Center"/>
Run Code Online (Sandbox Code Playgroud)
最后我找到了关于这个问题的解决方案。问题与 MvxAsyncCommand 有关,通过使用 Command 而不是 MvxAsyncCommand 解决。
我认为 MvvmCross MvxAsyncCommand 有一个关于运行异步方法的错误
| 归档时间: |
|
| 查看次数: |
871 次 |
| 最近记录: |