public void AddSingleItem(IChildTalkerTile ctTileToAdd) { if (ViewParents.Count > 0) { ViewParents.Peek().AddChild(ctTileToAdd); } else { _rootChildren.Add(ctTileToAdd); _xmlWrapper.Children.Add(ctTileToAdd.Xml); } PhraseButton ui = new PhraseButton(); ui.SetItem(ctTileToAdd); ui.SetParent(this); _ = items.Children.Add(ui); SaveToXml(_profilePath); }
public void LoadTiles(List <IChildTalkerTile> ctTiles, Boolean calledFromLoad = false) { //only true when page is first opened if (calledFromLoad) { _rootChildren = ctTiles; } else { if (!ctTiles.Contains(_backItem) && ViewParents.Count > 0) { ctTiles.Insert(0, _backItem); ViewParents.Peek().SetChildren(ctTiles); } } items.Children.Clear(); foreach (IChildTalkerTile item in ctTiles) { PhraseButton ui = new PhraseButton(); ui.SetItem(item); ui.SetParent(this); _ = items.Children.Add(ui); } if (calledFromLoad) { _xmlWrapper.Children = new List <ChildTalkerXml>(); foreach (IChildTalkerTile rootChild in ctTiles) { _xmlWrapper.Children.Add(rootChild.Xml); } } else { Scan.NewListToScanThough <PhraseButton>(items, skipnextscan: true); } }