地方名单:MvxBind粘合剂 [英] List of local:MvxBind binders

查看:531
本文介绍了地方名单:MvxBind粘合剂的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法找到所有类型的可用于粘合剂的列表,最近一个collegue发现关于地方:MvxBind =visibility属性,并且帮助了很多与我们的code。我相信这MvvMCross有很多隐藏的宝石,我们还不知道的。是信息可用的地方?

I couldn't find a list of all type of binders available for use, recently a collegue found about local:MvxBind="Visibility Property" and that helped a lot with our code. I belive that MvvMCross has a lot of hidden gems that we don't know yet. Is the information available somewhere?

粘合剂,我们知道:

  • 地方:MvxBind =Text属性
  • 地方:MvxBind =ItemsSource属性,SelectedItem属性
  • 地方:MvxBind =点击ICommandProperty
  • 地方:MvxBind =ItemsSource属性;项目单击ICommandProperty
  • 地方:MvxBind =visibility属性

谢谢!

推荐答案

MvvmCross结合到本地浏览C#的特性 - 因此受到Xamarin.Android暴露任何公开的C#的get / set属性可以是单向的必然

Automatic Property Binding

MvvmCross binds to C# properties on native Views - so any public C# get/set property exposed by Xamarin.Android can be one-way bound to.

另外,如果财产附有签名的事件公共事件的EventHandler FooChanged 然后MvvmCross可以在两个-way绑定到它。

Further, if the property Foo is accompanied by an event of signature public event EventHandler FooChanged then MvvmCross can two-way bind to it.

MvvmCross也结合任何公开 C#事件■哪些是由本地的观点暴露 - 只要他们有事件处理程序签名和不可以 事件处理程序< SomeSpecialArgs>

MvvmCross also binds to any public C# events which are exposed by native views - as long as they have EventHandler signatures and not EventHandler<SomeSpecialArgs>

这些可以自动绑定到的ICommand 主叫方(该动作被自动绑定到执行的处理程序,但< STRONG>什么自动绑定到 CanExecute )。

These can be automatically bound to ICommand callers (the action is automatically bound to the Execute handler, but nothing is automatically bound to the CanExecute).

除了这些直接的特性,MvvmCross也有设施,为自定义绑定。

Beyond these straight-forward properties, MvvmCross also has facilities for "custom bindings".

的自定义绑定的MvvmCross默认提供的列表是在 FillTargetBindings 在AndroidBindingBuilder - <一个href="https://github.com/MvvmCross/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Binding.Droid/MvxAndroidBindingBuilder.cs#L79">https://github.com/MvvmCross/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Binding.Droid/MvxAndroidBindingBuilder.cs#L79

The list of "custom bindings" that MvvmCross supplied by default is in FillTargetBindings in AndroidBindingBuilder - https://github.com/MvvmCross/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Binding.Droid/MvxAndroidBindingBuilder.cs#L79

        registry.RegisterCustomBindingFactory<TextView>("Text",
                                                        textView => new MvxTextViewTextTargetBinding(textView));
        registry.RegisterPropertyInfoBindingFactory((typeof(MvxAutoCompleteTextViewPartialTextTargetBinding)),
                                                typeof(AutoCompleteTextView), "PartialText");
        registry.RegisterPropertyInfoBindingFactory(
                                                typeof(MvxAutoCompleteTextViewSelectedObjectTargetBinding),
                                                typeof(AutoCompleteTextView),
                                                "SelectedObject");
        registry.RegisterPropertyInfoBindingFactory(typeof(MvxCompoundButtonCheckedTargetBinding),
                                                typeof(CompoundButton), "Checked");
        registry.RegisterPropertyInfoBindingFactory(typeof(MvxSeekBarProgressTargetBinging), typeof(SeekBar),
                                                "Progress");
        registry.RegisterCustomBindingFactory<View>("Visible",
                                                        view => new MvxViewVisibleBinding(view));
        registry.RegisterCustomBindingFactory<View>("Hidden",
                                                        view => new MvxViewHiddenBinding(view));
        registry.RegisterCustomBindingFactory<ImageView>("Bitmap",
                                                        imageView => new MvxImageViewBitmapTargetBinding(imageView));
        registry.RegisterCustomBindingFactory<ImageView>("DrawableId",
                                                        imageView => new MvxImageViewDrawableTargetBinding(imageView));
        registry.RegisterCustomBindingFactory<ImageView>("DrawableName",
                                                        imageView => new MvxImageViewDrawableNameTargetBinding(imageView));
        registry.RegisterCustomBindingFactory<ImageView>("AssetImagePath",
                                                         imageView => new MvxImageViewImageTargetBinding(imageView));
        registry.RegisterCustomBindingFactory<MvxSpinner>("SelectedItem",
                                                                         spinner =>
                                                                         new MvxSpinnerSelectedItemBinding(
                                                                             spinner));
        registry.RegisterCustomBindingFactory<AdapterView>("SelectedItemPosition",
                                                                          adapterView =>
                                                                          new MvxAdapterViewSelectedItemPositionTargetBinding
                                                                              (adapterView));
        registry.RegisterCustomBindingFactory<MvxListView>("SelectedItem",
                                                                          adapterView =>
                                                                          new MvxListViewSelectedItemTargetBinding
                                                                              (adapterView));
        registry.RegisterCustomBindingFactory<RatingBar>("Rating",
                                                        ratingBar => new MvxRatingBarRatingTargetBinding(ratingBar));
        registry.RegisterCustomBindingFactory<View>("LongClick",
                                                        view =>
                                                        new MvxViewLongClickBinding(view));
        registry.RegisterCustomBindingFactory<MvxRadioGroup>("SelectedItem",
            radioGroup => new MvxRadioGroupSelectedItemBinding(radioGroup));

一对夫妇的插件(特别是颜色)也加入自己的绑定。对

A couple of the plugins (notably Color) also add their own bindings.

有关添加自定义的绑定信息,请参阅<一href="http://slodge.blogspot.co.uk/2013/06/n28-custom-bindings-n1-days-of-mvvmcross.html">http://slodge.blogspot.co.uk/2013/06/n28-custom-bindings-n1-days-of-mvvmcross.html

For information on adding your own custom bindings, see http://slodge.blogspot.co.uk/2013/06/n28-custom-bindings-n1-days-of-mvvmcross.html

n + 1个主题上MvvmCross自定义控件,动漫和在地图上也值得关注 - 他们提供替代机制,以自定义绑定

The N+1 topics on MvvmCross custom controls, on animation and on maps are also worth watching - they provide alternative mechanisms to custom bindings.

更多关于MvvmCross结合,见<一href="https://github.com/MvvmCross/MvvmCross/wiki/Databinding">https://github.com/MvvmCross/MvvmCross/wiki/Databinding

For more on MvvmCross binding, see https://github.com/MvvmCross/MvvmCross/wiki/Databinding

这篇关于地方名单:MvxBind粘合剂的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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