Example #1
0
        public OffsetDataSetBase(ItemWrapper itemWrapper, double offset, double cellHeight)
        {
            ItemWrapper = itemWrapper;
            Offset      = offset;
            CellHeight  = cellHeight;

            /* the following is not a good idea because we really can and will agglomerate subGroups into cell views.
             * if (itemWrapper is GroupWrapper groupWrapper)
             * {
             *  CellHeight = groupWrapper.GroupHeaderRowHeight;
             *  if (CellHeight < 0 && groupWrapper.Parent is GroupWrapper parent)
             *      CellHeight = parent.GroupHeaderRowHeight;
             * }
             * if (CellHeight < 0)
             * {
             *  CellHeight = itemWrapper.RowHeight;
             *  if (CellHeight < 0 && itemWrapper.Parent is GroupWrapper parent)
             *      CellHeight = parent.RowHeight;
             * }
             */
        }
        internal BaseCellView MakeContentView(ItemWrapper item)
        {
            Type itemType = item.GetType();

            if (_contentTypes.ContainsKey(itemType))
            {
                Type contentType = _contentTypes[itemType];
                //var cellType = typeof(Cell<>).MakeGenericType (new[] { contentType });
                //var cellView = (BaseCellView)Activator.CreateInstance (cellType);
                //cellView.BindingContext = item;
                //return cellView;
                //System.Diagnostics.Debug.WriteLine("\t\tMakeContentView({0}) enter",item);
                var baseCellView = new BaseCellView();
                //var baseCellView = (BaseCellView)Activator.CreateInstance(BaseCellViewType);
                baseCellView.ContentView    = (View)Activator.CreateInstance(contentType);
                baseCellView.BindingContext = item;
                //System.Diagnostics.Debug.WriteLine("\t\tMakeContentView({0}) exit",item);
                return(baseCellView);
            }
            return(null);
        }
Example #3
0
 internal ItemTappedEventArgs(ItemWrapper itemWrapper) : base(itemWrapper.Parent?.Source, itemWrapper.Source, itemWrapper.Index)
 {
     CellView = itemWrapper.CellView;
 }
Example #4
0
 public DeepDataSet(ItemWrapper itemWrapper, double offset, int[] index, int flatIndex, double cellHeight) : base(itemWrapper, offset, cellHeight)
 {
     Index     = index;
     FlatIndex = flatIndex;
 }
Example #5
0
 public virtual string Description()
 {
     return(ItemWrapper.Description() + ", " + Offset + ", " + CellHeight);
 }
Example #6
0
 public override string ToString()
 {
     return("ItemWrapper[" + ItemWrapper.Description() + "] Offset[" + Offset + "] CellHeight[" + CellHeight + "]");
 }
 internal BaseCellView MakeContentView(ItemWrapper item)
 => (item.GetType() is Type itemType && _contentTypes.ContainsKey(itemType))
 /// <summary>
 /// Initialize instance of the <see cref="T:Forms9Patch.CellProximityEventArgs"/> class.
 /// </summary>
 /// <param name="itemWrapper"></param>
 /// <param name="deepIndex"></param>
 /// <param name="proximity"></param>
 public CellProximityEventArgs(ItemWrapper itemWrapper, int[] deepIndex, Proximity proximity = Proximity.None) : base(itemWrapper, deepIndex)
 {
     Proximity = proximity;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Forms9Patch.CellProximityEventArgs"/> class.
 /// </summary>
 /// <param name="groupWrapper"></param>
 /// <param name="itemWrapper"></param>
 /// <param name="proximity"></param>
 public CellProximityEventArgs(GroupWrapper groupWrapper, ItemWrapper itemWrapper, Proximity proximity = Proximity.None) : base(groupWrapper, itemWrapper)
 {
     Proximity = proximity;
 }
 public ItemWrapperLongPressEventArgs(ItemWrapper itemWrapper)
 {
     ItemWrapper = itemWrapper;
 }