protected override void RecycleElementCore(ElementFactoryRecycleArgs args) { var element = args.Element; var owner = args.Parent; var key = (String)(element as FrameworkElement).Tag; Debug.Assert(key != null); RecyclePool.PutElement((FrameworkElement)element, key, owner); #if DEBUG var containerAsFE = (FrameworkElement)element; switch (key) { case RecipeGroupType: { var repeater = (ItemsRepeater)containerAsFE.FindName("groupLayout"); var id = RepeaterTestHooks.GetLayoutId(repeater.Layout); RepeaterTestHooks.SetLayoutId(repeater.Layout, id + "*"); break; } case YearType: { var repeater = (ItemsRepeater)containerAsFE.FindName("yearLayout"); var id = RepeaterTestHooks.GetLayoutId(repeater.Layout); RepeaterTestHooks.SetLayoutId(repeater.Layout, id + "*"); break; } } #endif }
protected override void RecycleElementCore(ElementFactoryRecycleArgs args) { var repeater = (ItemsRepeater)((FrameworkElement)args.Element).FindName("groupLayout"); if (repeater != null) { // Make sure all elements are cleared. repeater.Layout = null; } _recyclePool.PutElement(args.Element, (string)((FrameworkElement)args.Element).Tag, args.Parent); }
protected override void RecycleElementCore(ElementFactoryRecycleArgs args) { }