Mono MVVMCross-Bound按钮事件未在按下时触发

Mono MVVMCross-Bound按钮事件未在按下时触发,mono,ios7,xamarin,mvvmcross,Mono,Ios7,Xamarin,Mvvmcross,我在Xamarin Studio中有一个iOS预约应用程序运行在Mono 2.10.11上 “约会详细信息”屏幕允许根据约会结果对约会进行评级。将根据基于业务逻辑的布尔集显示允许评级的按钮。“绑定”按钮触发分级屏幕的打开。它在iOS 6.1、移动和调试器以及iOS 7模拟器上正常工作。它在iOS 7设备上不工作 AppointView.cs包含函数ViewDidLoad,该函数设置按钮如下:- AppointmentViewTable.Source = _source; this.AddBin

我在Xamarin Studio中有一个iOS预约应用程序运行在Mono 2.10.11上

“约会详细信息”屏幕允许根据约会结果对约会进行评级。将根据基于业务逻辑的布尔集显示允许评级的按钮。“绑定”按钮触发分级屏幕的打开。它在iOS 6.1、移动和调试器以及iOS 7模拟器上正常工作。它在iOS 7设备上不工作

AppointView.cs包含函数ViewDidLoad,该函数设置按钮如下:-

AppointmentViewTable.Source = _source;

this.AddBindings (new Dictionary<object, string>
{
    { _source, "{'ItemsSource':{'Path':'AppointmentDetails'}, 'HeaderTitle':{'Path':'Appointment.AppointmentDate','converter':'DateTime'}}" },
    { btnRateSession, "{'Hidden':{'Path':'Appointment.RateAvailable','converter':'InvertedVisibility'}, 'Title':{'Path':'TextSource','Converter':'Language','ConverterParameter':'btnRateSession'}, 'TouchDown':{'Path':'GoToSessionRateView'}}"}
});
AppointmentViewTable.Source=\u Source;
this.AddBindings(新字典
{
{u source,{'ItemsSource':{'Path':'AppointmentDetails'},'HeaderTitle':{'Path':'Appointment.AppointmentDate','converter':'DateTime'},
{btnRateSession,“{'Hidden':{'Path':'Appointment.RateAvailable','converter':'InvertAdvisibility'},'Title':{'Path':'TextSource','converter':'Language','ConverterParameter':'btnRateSession'},'触地':{'Path':'GoToSessionRateView'}
});
通过创建约会视图运行程序时,我收到以下警告:-

2013-10-18 16:58:55.012 M2FitiOS[3773:a0b] MvxBind: Error:  14.12 Problem seen during binding execution for from Appointment.RateAvailable to Hidden - problem InvalidCastException: Null object can not be converted to a value type.
at System.Convert.ToType (System.Object value, System.Type conversionType, IFormatProvider provider, Boolean try_target_to_type) [0x00017] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Convert.cs:2553 
at System.Convert.ChangeType (System.Object value, System.Type conversionType, IFormatProvider provider) [0x00017] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Convert.cs:2204 
at Cirrious.MvvmCross.Binding.ExtensionMethods.MvxTypeExtensions.MakeSafeValue (System.Type propertyType, System.Object value) [0x00000] in <filename unknown>:0 
at Cirrious.MvvmCross.Binding.Bindings.Target.MvxPropertyInfoTargetBinding.SetValue (System.Object value) [0x00000] in <filename unknown>:0 
at Cirrious.MvvmCross.Binding.Bindings.MvxFullBinding.UpdateTargetFromSource (Boolean isAvailable, System.Object value) [0x00000] in <filename unknown>:0
2013-10-18 16:58:55.012 M2FitiOS[3773:a0b]MvxBind:错误:14.12从约会绑定执行期间发现问题。RateAvailable to Hidden-Problem InvalidCastException:Null对象无法转换为值类型。
在/Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Convert.cs:2553中的System.Convert.ToType(System.Object值、System.Type转换类型、IFormatProvider提供程序、布尔try_target_to_Type)[0x00017]处
在/Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Convert.cs:2204中的System.Convert.ChangeType(System.Object值、System.Type转换类型、IFormatProvider提供程序)[0x00017]处
在Cirriary.MvvmCross.Binding.ExtensionMethods.MvxTypeExtensions.MakeSafeValue(System.Type propertyType,System.Object value)[0x00000]中:0
在Cirrium.MvvmCross.Binding.Bindings.Target.MvxPropertyInfoTargetBinding.SetValue(System.Object值)[0x00000]处,输入:0
在cirriary.MvvmCross.Binding.Bindings.MvxFullBinding.UpdateTargetFromSource(布尔值可用,系统对象值)[0x00000]中:0
AppointmentViewModel包含以下事件:-

public ICommand GoToSessionRateView
{
    get
        {
            return new MvxRelayCommand(() => RequestNavigate<SessionRateViewModel>(new { appointmentId = _appointmentId }));
        }
    }
public ICommand GoToSessionRateView
{
得到
{
返回新的MvxRelayCommand(()=>RequestNavigate(new{appointmentId=_appointmentId}));
}
}

不确定是什么导致事件停止工作。任何指针都将受到欢迎。

一般来说,设备上不起作用的事情都是由于Xamarin“链接器”造成的,可以使用许多选项解决-请参阅

当这种情况发生时,我的首选选项是使用
LinkerPleaseInclude.cs
类文件

如果这是您的问题所在,那么您需要确保LinkerPleaseInclude包含一个
TouchDown
参考-尽管如果您实际上将绑定更改为
TouchUpInside
,您可能会更高兴



同时,您的跟踪显示,
Appointment.rate可用于Hidden
中有一个错误-我不明白为什么在ios7上会有所不同。我想在这个旧版本的MvvmCross中解决这个问题最简单的方法可能是升级。。。虽然也有可能简单地将
转换器更改为
转换器可能会有所帮助。

一般来说,在设备上不起作用的原因是Xamarin“链接器”,可以使用许多选项解决-请参阅

当这种情况发生时,我的首选选项是使用
LinkerPleaseInclude.cs
类文件

如果这是您的问题所在,那么您需要确保LinkerPleaseInclude包含一个
TouchDown
参考-尽管如果您实际上将绑定更改为
TouchUpInside
,您可能会更高兴



同时,您的跟踪显示,
Appointment.rate可用于Hidden
中有一个错误-我不明白为什么在ios7上会有所不同。我想在这个旧版本的MvvmCross中解决这个问题最简单的方法可能是升级。。。尽管也有可能简单地将
转换器
更改为
转换器
可能会有所帮助。

有些内容为空。解决这个问题。我还建议使用最新版本的MvvmCross。有些东西是空的。解决这个问题。我还建议使用最新版本的MvvmCross。谢谢你的建议。开始升级,谢谢你的建议。位构建并开始升级。