No description, website, or topics provided.
C#
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
AlexeysExtensions.Touch
Sample
.gitattributes
.gitignore
MvvmCross.AlexeysExtensions.sln
README.md

README.md

MvvmCross.AlexeysExtensions

BindableSection<TElementTemplate>

MonoTouch.Dialog section element that supports data binding. A collection of elements should be bound to ItemsSource property. An element of type TElementTemplate will be created at run-time for each of the items in the collection. These elements are expected to implement an interface IBindableElement and take care of the data binding inside of the element.
    public class SampleStringElement : StringElement, IBindableElement
    {
        public SampleStringElement()
            : base(string.Empty)
        {
            
        }

        protected override MonoTouch.UIKit.UITableViewCell GetCellImpl(MonoTouch.UIKit.UITableView tv)
        {
            //Implement binding of Title property in the business object to Caption propery of String Element
            this.Bind(MvxBindingTouchView, DataContext, "{'Caption':{'Path':'Title'}}");

            return base.GetCellImpl(tv);
        }

        #region IBindableElement
        public Cirrious.MvvmCross.Binding.Touch.Interfaces.IMvxBindingTouchView MvxBindingTouchView { get; set; }

        public object DataContext { get; set; }
        #endregion
    }

Using BindableSection inside of MonoTouch.Dialog:

        BindableSection<SampleStringElement> StringElementsSection { get; set; }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            StringElementsSection = new BindableSection<SampleStringElement>(this, "String Elements");

            Root = new RootElement("Sample")
            {
                StringElementsSection
            };

            StringElementsSection.Bind(this, "{'ItemsSource':{'Path':'MyObjects'}}");
        }

See Sample project for more detailed example.