Пример #1
0
        /// <summary>
        /// Override of the <see cref="CellRenderer"/> GetCellCore method, used to apply any custom
        /// settings to the Android platform-specific cell display element.
        /// </summary>
        /// <returns>The Android platform-specific cell display element after applying any custom settings to it</returns>
        /// <param name="item">The <see cref="T:Xamarin.Forms.Cell"/> instance whose properties need to be transferred
        /// from</param>
        /// <param name="convertView">A previously-created Android platform-specific display element if this cell has
        /// been rendered before</param>
        /// <param name="parent">The parent Android view container for the cell</param>
        /// <param name="context">The Android context that should be used for retrieving assets</param>
        protected override AView GetCellCore(Cell item, AView convertView, AViewGroup parent, Context context)
        {
            var cell = (SwitchCell)Cell;

            if ((_view = convertView as SwitchCompatCellView) == null)
            {
                _view = new SwitchCompatCellView(context, item);
            }

            _view.Cell = cell;

            UpdateText();
            UpdateChecked();
            UpdateHeight();
            UpdateIsEnabled(_view, cell);

            DroidXFGlossSwitchCompatCellRenderer.UpdateProperties(item, _view);
            return(_view);
        }