MvxBind:错误:视图类型未发现 - mvvmemiextensions.EmiDatePicker [英] MvxBind:Error: View type not found - mvvmemiextensions.EmiDatePicker

查看:178
本文介绍了MvxBind:错误:视图类型未发现 - mvvmemiextensions.EmiDatePicker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用EmiDatePicker但在打开视图一个出现此错误:

MvxBind:错误:452,00视图类型未发现 - mvvmemiextensions.EmiDatePicker
03-13 16:31:21.439 I /单标准输出(20760):MvxBind:错误:452,00视图类型未发现 - mvvmemiextensions.EmiDatePicker
[0:] MvxBind:错误:452,00视图类型未发现 - mvvmemiextensions.EmiDatePicker

目前AXML ...

 < mvvmemiextensions.EmiDatePicker
本地:MvxBind =值SomeDateValue
机器人:layout_width =FILL_PARENT
机器人:layout_height =WRAP_CONTENT
机器人:layout_marginLeft =5DP
机器人:layout_marginTop =5DP
机器人:文字颜色=#000000
机器人:TEXTSIZE =18dp/>

目前Setup.cs

 保护覆盖无效FillTargetFactories(IMvxTargetBindingFactoryRegistry注册表)
{
        尝试
        {
            registry.RegisterFactory(新MvxSimplePropertyInfoTargetBindingFactory(typeof运算(EmiDatePickerValueTargetBinding)的typeof(EmiDatePicker),值));
            registry.RegisterFactory(新MvxSimplePropertyInfoTargetBindingFactory(typeof运算(EmiTimePickerValueTargetBinding)的typeof(EmiTimePicker),值));            base.FillTargetFactories(注册表);
        }
        赶上(异常前)
        {
            扔;
        }
    }


解决方案

如果您已经从一个单独的程序拉到EmiPicker在,那么你需要让MvvmCross知道大会的是 - 看<一个href=\"https://github.com/MvvmCross/MvvmCross/wiki/Customising-using-App-and-Setup#providing-custom-views-android\" rel=\"nofollow\">https://github.com/MvvmCross/MvvmCross/wiki/Customising-using-App-and-Setup#providing-custom-views-android

如果您复制了EmiPicker的到当前的UI组件,那么你应该不需要 mvvmemiextensions prefixes

如果一切都失败了,你应该能够使用内置的MvxDatePicker和MvxTimePicker - 这是由Emi的启发:)见例如ApiExamples样品中使用 - 例如<一href=\"https://github.com/MvvmCross/MvvmCross-Tutorials/blob/master/ApiExamples/ApiExamples.Droid/Resources/Layout/Test_Time.axml\" rel=\"nofollow\">https://github.com/MvvmCross/MvvmCross-Tutorials/blob/master/ApiExamples/ApiExamples.Droid/Resources/Layout/Test_Time.axml

I'm using EmiDatePicker but, at open the View a this Error occurs:

MvxBind:Error:452,00 View type not found - mvvmemiextensions.EmiDatePicker 03-13 16:31:21.439 I/mono-stdout(20760): MvxBind:Error:452,00 View type not found - mvvmemiextensions.EmiDatePicker [0:] MvxBind:Error:452,00 View type not found - mvvmemiextensions.EmiDatePicker

At AXML...

<mvvmemiextensions.EmiDatePicker
local:MvxBind="Value SomeDateValue"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="5dp"
android:textColor="#000000"
android:textSize="18dp" />

At Setup.cs

protected override void FillTargetFactories(IMvxTargetBindingFactoryRegistry registry)
{
        try
        {
            registry.RegisterFactory(new MvxSimplePropertyInfoTargetBindingFactory(typeof(EmiDatePickerValueTargetBinding), typeof(EmiDatePicker), "Value"));
            registry.RegisterFactory(new MvxSimplePropertyInfoTargetBindingFactory(typeof(EmiTimePickerValueTargetBinding), typeof(EmiTimePicker), "Value"));

            base.FillTargetFactories(registry);
        }
        catch (Exception ex)
        {
            throw;
        }
    }

解决方案

If you've pulled the EmiPicker's in from a separate Assembly, then you need to let MvvmCross know the Assembly those are in - see https://github.com/MvvmCross/MvvmCross/wiki/Customising-using-App-and-Setup#providing-custom-views-android

If you've copied the EmiPicker's into the current UI Assembly, then you shouldn't need the mvvmemiextensions prefixes

If all else fails, you should be able to use the built-in MvxDatePicker and MvxTimePicker - which were inspired by Emi's work :) See example uses in the ApiExamples sample - e.g. https://github.com/MvvmCross/MvvmCross-Tutorials/blob/master/ApiExamples/ApiExamples.Droid/Resources/Layout/Test_Time.axml

这篇关于MvxBind:错误:视图类型未发现 - mvvmemiextensions.EmiDatePicker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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