TextInputEditText:ArgumentNullException:MvxWeakEventSubscription中缺少源事件信息 [英] TextInputEditText: ArgumentNullException: missing source event info in MvxWeakEventSubscription

查看:65
本文介绍了TextInputEditText:ArgumentNullException:MvxWeakEventSubscription中缺少源事件信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然之间,我的TextInputEditText的绑定开始失败,并且与链接程序有关.如果我将链接器设置为无",则一切正常.即时通讯使用的其他许多绑定仍然可以正常工作.

All of a sudden the binding for my TextInputEditText started failing, and it has something to do with the Linker. If I set the linker to "None", everything works as intended. Alot of other bindings im using still works just fine.

堆栈即时获取:

在视图绑定期间引发的异常ArgumentNullException:MvxWeakEventSubscription中缺少源事件信息参数名称:sourceEventInfo 在Dv:\ git \ MvvmCross \ MvvmCross \ Platform \ Platform \ WeakSubscription \ MvxWeakEventSubscription.cs:47中的MvvmCross.Platform.WeakSubscription.MvxWeakEventSubscription 2[TSource,TEventArgs]..ctor (Android.Widget.TextView source, System.Reflection.EventInfo sourceEventInfo, System.EventHandler 1 [TEventArgs] targetEventHandler)[0x00017] 在D:\ git \ MvvmCross \ MvvmCross \ Platform \ Platform \ WeakSubscription \ MvxWeakEventSubscription.cs:34中的MvvmCross.Platform.WeakSubscription.MvxWeakEventSubscription 2[TSource,TEventArgs]..ctor (Android.Widget.TextView source, System.String sourceEventName, System.EventHandler 1 [TEventArgs] targetEventHandler)[0x00000] 在MvvmCross.Platform.WeakSubscription.MvxWeakSubscriptionExtensionMethods.WeakSubscribe [TSource,TEventArgs](TSource源,System.String eventName,System.EventHandler 1[TEventArgs] eventHandler) [0x00000] in D:\git\MvvmCross\MvvmCross\Platform\Platform\WeakSubscription\MvxWeakSubscriptionExtensionMethods.cs:81 at MvvmCross.Binding.Droid.Target.MvxTextViewTextTargetBinding.SubscribeToEvents () [0x0000b] in <6a0c851a22864d0993089d65320a630c>:0 at MvvmCross.Binding.Bindings.MvxFullBinding.CreateTargetBinding (System.Object target) [0x00057] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\MvxFullBinding.cs:157 at MvvmCross.Binding.Bindings.MvxFullBinding..ctor (MvvmCross.Binding.MvxBindingRequest bindingRequest) [0x00028] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\MvxFullBinding.cs:64 at MvvmCross.Binding.Binders.MvxFromTextBinder.BindSingle (MvvmCross.Binding.MvxBindingRequest bindingRequest) [0x00000] in D:\git\MvvmCross\MvvmCross\Core\Binding\Binders\MvxFromTextBinder.cs:56 at MvvmCross.Binding.Binders.MvxFromTextBinder+<>c__DisplayClass2_0.<Bind>b__0 (MvvmCross.Binding.Bindings.MvxBindingDescription description) [0x00000] in D:\git\MvvmCross\MvvmCross\Core\Binding\Binders\MvxFromTextBinder.cs:38 at System.Linq.Enumerable+<CombineSelectors>c__AnonStorey1D 3 [TSource,TMiddle,TResult].)上.m__0(TSource x)[0x00012]在:0 在System.Linq.Enumerable + c__AnonStorey1D 3[TSource,TMiddle,TResult].<>m__0 (TSource x) [0x00000] in <fcebdd9506364c04ba70cbb6c51ded52>:0 at System.Linq.Enumerable+WhereSelectEnumerableIterator 2 [TSource,TResult]处.MoveNext()[0x00064]在:0中 在< 2f8f5c28c7474bed8a8f35ed56258fb1>:0中的System.Collections.Generic.List 1[T].InsertRange (System.Int32 index, System.Collections.Generic.IEnumerable 1 [T]集合)[0x000ff]中 在< 2f8f5c28c7474bed8a8f35ed56258fb1>:0中的System.Collections.Generic.List 1[T].AddRange (System.Collections.Generic.IEnumerable 1 [T]集合)[0x00000]中 在< 6a0c851a22864d0993089d65320a630c> :: 0上的MvvmCross.Binding.Droid.Binders.MvxAndroidViewBinder.StoreBindings(Android.Views.View view,System.Collections.Generic.IEnumerable`1 [T] newBindings)[0x00028]中 在< 6a0c851a22864d0993089d65320a630c>:0

Exception thrown during the view binding ArgumentNullException: missing source event info in MvxWeakEventSubscription Parameter name: sourceEventInfo at MvvmCross.Platform.WeakSubscription.MvxWeakEventSubscription2[TSource,TEventArgs]..ctor (Android.Widget.TextView source, System.Reflection.EventInfo sourceEventInfo, System.EventHandler1[TEventArgs] targetEventHandler) [0x00017] in D:\git\MvvmCross\MvvmCross\Platform\Platform\WeakSubscription\MvxWeakEventSubscription.cs:47 at MvvmCross.Platform.WeakSubscription.MvxWeakEventSubscription2[TSource,TEventArgs]..ctor (Android.Widget.TextView source, System.String sourceEventName, System.EventHandler1[TEventArgs] targetEventHandler) [0x00000] in D:\git\MvvmCross\MvvmCross\Platform\Platform\WeakSubscription\MvxWeakEventSubscription.cs:34 at MvvmCross.Platform.WeakSubscription.MvxWeakSubscriptionExtensionMethods.WeakSubscribe[TSource,TEventArgs] (TSource source, System.String eventName, System.EventHandler1[TEventArgs] eventHandler) [0x00000] in D:\git\MvvmCross\MvvmCross\Platform\Platform\WeakSubscription\MvxWeakSubscriptionExtensionMethods.cs:81 at MvvmCross.Binding.Droid.Target.MvxTextViewTextTargetBinding.SubscribeToEvents () [0x0000b] in <6a0c851a22864d0993089d65320a630c>:0 at MvvmCross.Binding.Bindings.MvxFullBinding.CreateTargetBinding (System.Object target) [0x00057] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\MvxFullBinding.cs:157 at MvvmCross.Binding.Bindings.MvxFullBinding..ctor (MvvmCross.Binding.MvxBindingRequest bindingRequest) [0x00028] in D:\git\MvvmCross\MvvmCross\Core\Binding\Bindings\MvxFullBinding.cs:64 at MvvmCross.Binding.Binders.MvxFromTextBinder.BindSingle (MvvmCross.Binding.MvxBindingRequest bindingRequest) [0x00000] in D:\git\MvvmCross\MvvmCross\Core\Binding\Binders\MvxFromTextBinder.cs:56 at MvvmCross.Binding.Binders.MvxFromTextBinder+<>c__DisplayClass2_0.<Bind>b__0 (MvvmCross.Binding.Bindings.MvxBindingDescription description) [0x00000] in D:\git\MvvmCross\MvvmCross\Core\Binding\Binders\MvxFromTextBinder.cs:38 at System.Linq.Enumerable+<CombineSelectors>c__AnonStorey1D3[TSource,TMiddle,TResult].<>m__0 (TSource x) [0x00012] in :0 at System.Linq.Enumerable+c__AnonStorey1D3[TSource,TMiddle,TResult].<>m__0 (TSource x) [0x00000] in <fcebdd9506364c04ba70cbb6c51ded52>:0 at System.Linq.Enumerable+WhereSelectEnumerableIterator2[TSource,TResult].MoveNext () [0x00064] in :0 at System.Collections.Generic.List1[T].InsertRange (System.Int32 index, System.Collections.Generic.IEnumerable1[T] collection) [0x000ff] in <2f8f5c28c7474bed8a8f35ed56258fb1>:0 at System.Collections.Generic.List1[T].AddRange (System.Collections.Generic.IEnumerable1[T] collection) [0x00000] in <2f8f5c28c7474bed8a8f35ed56258fb1>:0 at MvvmCross.Binding.Droid.Binders.MvxAndroidViewBinder.StoreBindings (Android.Views.View view, System.Collections.Generic.IEnumerable`1[T] newBindings) [0x00028] in <6a0c851a22864d0993089d65320a630c>:0 at MvvmCross.Binding.Droid.Binders.MvxAndroidViewBinder.ApplyBindingsFromAttribute (Android.Views.View view, Android.Content.Res.TypedArray typedArray, System.Int32 attributeId) [0x0001c] in <6a0c851a22864d0993089d65320a630c>:0

我已经将以下内容添加到"LinkerPleaseInclude"中,但没有帮助.

I've already added the following to "LinkerPleaseInclude", but it didnt help.

    public void Include(TextInputEditText text)
    {
        text.TextChanged += (sender, args) => text.Text = "" + text.Text;
        text.Hint = "" + text.Hint;
        text.Background = (Drawable)Android.Resource.Color.Black;
        text.Text = "Text" + text.Text;
    }

    public void Include(TextInputLayout text)
    {
        text.Hint = "" + text.Hint;
        text.Background = (Drawable)Android.Resource.Color.Black;
    }

将TextInputEditText更改为简单的EditText都不起作用,并且会引发相同的异常.

Changing the TextInputEditText to a simple EditText, doesnt help either and throws the same exception.

我想念什么?通过查看堆栈,我无法更接近解决方案.

What am I missing? Im not getting any closer to a solution by looking at the stack.

推荐答案

经过一番挖掘,我发现了这个答案显示MvvmCross的新版本(v4.4.0)中发生了更改,需要对项目的LinkerPleaseInclude.cs

After some digging around I found this answer that shows there was a change in the new version (v4.4.0) of MvvmCross that requires a tweak to the section for TextView in your project's LinkerPleaseInclude.cs

这篇关于TextInputEditText:ArgumentNullException:MvxWeakEventSubscription中缺少源事件信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆