Пример #1
0
 public void RemoveSingleTile(PhraseButton itemToRemove)
 {
     items.Children.Remove(itemToRemove);
     if (ViewParents.Count > 0)
     {
         ViewParents.Peek().RemoveChild(itemToRemove.CtTile);
     }
     else
     {
         _ = _rootChildren.Remove(itemToRemove.CtTile);
         _ = _xmlWrapper.Children.Remove(itemToRemove.CtTile.Xml);
     }
     SaveToXml(_profilePath);
 }
Пример #2
0
        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);
        }
Пример #3
0
        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);
            }
        }
Пример #4
0
 public void UpdateSavedTiles(PhraseButton itemToChange, String path)
 {
     itemToChange.CtTile.Xml.ImagePath = path;
     SaveToXml(_profilePath);
 }