Example #1
0
 public static Binder <TSource, UITableView> Source <TSource, TPropertyType>(this Binder <TSource, UITableView> binder, Expression <Func <TSource, TPropertyType> > property, Action <TSource, UITableView, CollectionSource <TSource> > registerViews, IConverter <TPropertyType, CollectionSource <TSource> > converter = null, bool fromNibs = true)
     where TSource : class
 {
     return(binder.ObserveProperty(property, (s, v, collection) =>
     {
         collection.ClearViews();
         registerViews(s, v, collection);
         v.Source = new TableViewSourceBinding <TSource>(v, collection, fromNibs);
         v.ReloadData();
     }, converter));
 }
Example #2
0
 public static Binder <TSource, RecyclerView> Source <TSource, TPropertyType>(this Binder <TSource, RecyclerView> binder, Expression <Func <TSource, TPropertyType> > property, Action <TSource, RecyclerView, CollectionSource <TSource> > registerViews, IConverter <TPropertyType, CollectionSource <TSource> > converter = null)
     where TSource : class
 {
     return(binder.ObserveProperty(property, (s, v, collection) =>
     {
         collection.ClearViews();
         registerViews(s, v, collection);
         var adapter = new RecyclerViewAdapterBinding <TSource>(collection);
         v.SetAdapter(adapter);
         adapter.NotifyDataSetChanged();                 // TODO ? Needed
     }, converter));
 }