示例#1
0
        public override void SetBinding(EvasObject native, int index)
        {
            if (_nativeFormsTable.TryGetValue(native, out View? view))
            {
                ResetBindedView(view);
                var item = this[index];
                if (item != null)
                {
                    view.BindingContext        = item;
                    _dataBindedViewTable[item] = view;
                }

                view.MeasureInvalidated += OnItemMeasureInvalidated;
                Shell.AddLogicalChild(view);
            }
        }
示例#2
0
        internal UIContainerCell(string cellId, View view, Shell shell, object context) : base(UITableViewCellStyle.Default, cellId)
        {
            View = view;
            View.MeasureInvalidated += MeasureInvalidated;
            SelectionStyle           = UITableViewCellSelectionStyle.None;

            _renderer = Platform.CreateRenderer(view);
            Platform.SetRenderer(view, _renderer);

            ContentView.AddSubview(_renderer.NativeView);
            _renderer.NativeView.ClipsToBounds = true;
            ContentView.ClipsToBounds          = true;

            BindingContext = context;
            if (shell != null)
            {
                shell.AddLogicalChild(View);
            }
        }
示例#3
0
        internal UIContainerCell(string cellId, View view, Shell shell, object context) : base(UITableViewCellStyle.Default, cellId)
        {
            View = view;
            View.MeasureInvalidated += MeasureInvalidated;
            SelectionStyle           = UITableViewCellSelectionStyle.None;

            _renderer = (IPlatformViewHandler)view.Handler;

            if (_renderer == null)
            {
                _renderer = (IPlatformViewHandler)view.ToHandler(shell.FindMauiContext());
            }

            ContentView.AddSubview(_renderer.PlatformView);
            _renderer.PlatformView.ClipsToBounds = true;
            ContentView.ClipsToBounds            = true;

            BindingContext = context;
            if (shell != null)
            {
                shell.AddLogicalChild(View);
            }
        }