MvvmCross Android Dialog bind programmatically

二次信任 提交于 2019-12-05 19:40:18

I don't know if there are any monodroid.dialog mvvmcross samples floating around which don't use autoviews!

However.... the basic syntac for binding should be the same as MonoTouch.Dialog - e.g. something like:

                            new Section("Contact Info")
                                {
                                    new StringElement("ID", ViewModel.Customer.ID ?? string.Empty),
                                    new EntryElement("Name", "Name").Bind(this, "{'Value':{'Path':'Customer.Name'}}"),
                                    new EntryElement("Website", "Website").Bind(this, "{'Value':{'Path':'Customer.Website'}}"),
                                    new EntryElement("Primary Phone", "Phone").Bind(this, "{'Value':{'Path':'Customer.PrimaryPhone'}}"),
                                },
                            new Section("Primary Address")
                                {
                                    new EntryElement("Address").Bind(this, "{'Value':{'Path':'Customer.PrimaryAddress.Street1'}}"),
                                    new EntryElement("Address2").Bind(this, "{'Value':{'Path':'Customer.PrimaryAddress.Street2'}}"),
                                    new EntryElement("City").Bind(this, "{'Value':{'Path':'Customer.PrimaryAddress.City'}}"),
                                    new EntryElement("State").Bind(this, "{'Value':{'Path':'Customer.PrimaryAddress.State'}}"),
                                    new EntryElement("Zip").Bind(this, "{'Value':{'Path':'Customer.PrimaryAddress.Zip'}}"),
                                },

from https://github.com/slodge/MvvmCross/blob/vnext/Sample%20-%20CustomerManagement/CustomerManagement/CustomerManagement.Touch/Views/BaseCustomerEditView.cs


Note that in MvvmCross bindings for MonoTouch and MonoDroid, the default binding for things like text edit boxes is generally TwoWay by default.


If you do get a sample running, then please feel free to post it to a gist or to a repo - or to blog about it - looks like we could do with some samples to work from!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!