コード例 #1
0
        protected override UIElement GetElementCore(ElementFactoryGetArgs args)
        {
            int index = RepeaterTestHooks.GetElementFactoryElementIndex(args);

            _recordedGetElementCalls.Add(new GetElementCallInfo(index, args.Parent));
            return(GetElementFunc != null?GetElementFunc(index, args.Parent) : null);
        }
コード例 #2
0
        protected override UIElement GetElementCore(ElementFactoryGetArgs args)
        {
            var button = new Button();

            button.Content = args.Data;
            return(button);
        }
コード例 #3
0
        protected override UIElement GetElementCore(ElementFactoryGetArgs args)
        {
            var element = (FrameworkElement)_personTemplate.LoadContent();

            element.DataContext = args.Data;
            return(element);
        }
コード例 #4
0
            protected override UIElement GetElementCore(ElementFactoryGetArgs args)
            {
                var element = _recyclePool.TryGetElement(key, args.Parent);

                if (element == null)
                {
                    element = new Button()
                    {
                        Width = 100, Height = 100
                    };
                }

                var elementManager = new ElementPhasingManager(_numPhases);

                XamlBindingHelper.SetDataTemplateComponent(element, elementManager);
                return(element);
            }
コード例 #5
0
        protected override UIElement GetElementCore(ElementFactoryGetArgs context)
        {
            UIElement element = base.GetElementCore(context);
            int       index   = RepeaterTestHooks.GetElementFactoryElementIndex(context);

            if (GetElementFunc != null)
            {
                element = GetElementFunc(index, context.Parent, element);
            }

            if (!RealizedElementIndices.Contains(index))
            {
                _realizedElements.Add(element);
                _realizedElementIndices.Add(index);
            }
            else if (ValidateElementIndices)
            {
                throw new InvalidOperationException("Cannot request an element that has already been realized.");
            }

            return(element);
        }
コード例 #6
0
 protected override UIElement GetElementCore(ElementFactoryGetArgs args)
 {
     return(args.Data as UIElement);
 }
コード例 #7
0
ファイル: RepeaterTestHooks.cs プロジェクト: Robert-Louis/Uno
        /* static */
        public static object CreateRepeaterElementFactoryGetArgs()
        {
            var instance = new ElementFactoryGetArgs();

            return(instance);
        }