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);
        }
Ejemplo n.º 2
0
        protected override UIElement GetElementCore(ElementFactoryGetArgs args)
        {
            var button = new Button();

            button.Content = args.Data;
            return(button);
        }
        protected override UIElement GetElementCore(ElementFactoryGetArgs args)
        {
            var element = (FrameworkElement)_personTemplate.LoadContent();

            element.DataContext = args.Data;
            return(element);
        }
Ejemplo n.º 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);
            }
        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);
        }
Ejemplo n.º 6
0
 protected override UIElement GetElementCore(ElementFactoryGetArgs args)
 {
     return(args.Data as UIElement);
 }
Ejemplo n.º 7
0
        /* static */
        public static object CreateRepeaterElementFactoryGetArgs()
        {
            var instance = new ElementFactoryGetArgs();

            return(instance);
        }