public static void AddTemplate(this IComponentContainListTemplate listTemplate, IHasTemplate template) { //Add to list listTemplate.ListTemplate.Add(template); //return; //TODO : get better //remove from origin drawable //template.RemoveTemplateFromChild();//TODO : impliment //add to drawable var list = (listTemplate as Container).Children.ToList(); if (list.Count == 0) { list.Add(template.DrawableObject.CreateProxy()); (listTemplate as Container).Children = list.ToArray();//TODO : impliment } else { //TODO : connot add (listTemplate as Container).Add((template.DrawableObject.CreateProxy())); } }
public static void RemoveTemplate(this IComponentContainListTemplate listTemplate, IHasTemplate template) { //remove from drawable //template.AddTemplateToChild(); (listTemplate as Container).Children.ToList().Remove(template.DrawableObject); //Add to list listTemplate.ListTemplate.Remove(template); }
public static float TotalHeight(this IComponentContainListTemplate componentContainListTemplate) { int layerCount = componentContainListTemplate.ListTemplate.Count; if (layerCount > 0) { return(CONTAINER_TO_FIRST_LAYOUT_HEIGHT * 2 + LAYOUT_HEIGHT * layerCount + LAYOUT_INTERVAL_HEIGHT * layerCount - 1); } return(CONTAINER_TO_FIRST_LAYOUT_HEIGHT * 2 + 20); }