public void Apply(IPrimitive primitive, IShadow <Xamarin.Forms.View> shadowView)
        {
            //_gridList.Add

            var row    = primitive.Attributes.GetAttributeOrDefault(GridExtensions.Row);
            var column = primitive.Attributes.GetAttributeOrDefault(GridExtensions.Column);

            var rowSpan    = primitive.Attributes.GetAttributeOrDefault(GridExtensions.RowSpan);
            var columnSpan = primitive.Attributes.GetAttributeOrDefault(GridExtensions.ColumnSpan);

            // now then, how to apply...

            _grid.Children.Add(shadowView.Item, row, column, rowSpan, columnSpan);

            // so, if the row/column, rowSpan or columnSpan have changed then
            // we need to do a remove and an insert - this is for updates

            // otherwise its an add

            // similarly, you can't do an insert at a position, its always an add !
            // which makes for collection comparison a bit interesting ?

            // the collection may say, do an insert at a position, but thats not possible with the current api , and instead
            // we have to return to using the column span and row things instead...

            // we could, just apply the view changes BUT.. we have an order problem
            //Grid.SetColumn(shadowView.Item,column);
        }
Example #2
0
 public CollectionViewConnector(IShadow <Xamarin.Forms.CarouselView> shadow)
 {
     Shadow = shadow;
     // create the backing store ...
     _items = new ObservableCollection <PrimitiveHolder>();
     Shadow.Item.ItemsSource = _items;
 }
Example #3
0
        /// <summary>
        /// Invoke the method with the specified values
        /// </summary>
        /// <param name="shadow"></param>
        /// <param name="attributes"></param>
        protected override void Set(IShadow <TView> shadow, object[] attributes)
        {
            if (MethodOperation.IsLoggingEnabled.Value)
            {
                Logging.Instance.LogInformation("Method called:{name} on:{object} with:{attributes}", _method.Name, shadow.Item.GetType().Name, attributes);
            }

            try
            {
                _method.Invoke(shadow.Item, attributes);
            }
            catch (Exception exception)
            {
                throw new ArgumentException($"Invocation of method:{_method.Name} failure on type:{shadow.Item.GetType()} ", exception);
            }
        }