protected override void RecycleElementCore(ElementFactoryRecycleArgs args)
 {
     _recordedRecycleElementCalls.Add(new RecycleElementCallInfo(args.Element, args.Parent));
     if (ClearElementFunc != null)
     {
         ClearElementFunc(args.Element, args.Parent);
     }
 }
        protected override void RecycleElementCore(ElementFactoryRecycleArgs context)
        {
            base.RecycleElementCore(context);
            if (ClearElementFunc != null)
            {
                ClearElementFunc(context.Element, context.Parent);
            }

            int elementIndex = _realizedElements.IndexOf(context.Element);

            if (elementIndex != -1)
            {
                _realizedElements.RemoveAt(elementIndex);
                _realizedElementIndices.RemoveAt(elementIndex);
            }
            else if (ValidateElementIndices)
            {
                throw new InvalidOperationException("Cannot clear an element that has not been created or already been cleared.");
            }
        }
예제 #3
0
 protected override void RecycleElementCore(ElementFactoryRecycleArgs args)
 {
 }
예제 #4
0
 protected override void RecycleElementCore(ElementFactoryRecycleArgs args)
 {
     XamlBindingHelper.GetDataTemplateComponent(args.Element).Recycle();
     _recyclePool.PutElement(args.Element, key, args.Parent);
 }
예제 #5
0
        /* static */
        public static object CreateRepeaterElementFactoryRecycleArgs()
        {
            var instance = new ElementFactoryRecycleArgs();

            return(instance);
        }
예제 #6
0
        protected override void RecycleElementCore(ElementFactoryRecycleArgs args)
        {
            var container = args.Element as Button;

            container.Content = null;
        }