Example #1
0
        public static GroupModel GetDataSrouce()
        {
            GroupModel _datasource = new GroupModel();
            string meneXmlPath = Path.Combine(Windows.ApplicationModel.Package.Current.InstalledLocation.Path, "Lib/Data/MainMenu.xml");

            XDocument loadData = XDocument.Load(meneXmlPath);

            DataGroup dataGroup = null;
            var groups = loadData.Root.Elements();
            foreach (var group in groups)
            {
                dataGroup = new DataGroup(group.Attribute("uniqueId").Value, group.Attribute("title").Value, group.Attribute("imagePath").Value);
                foreach (var dataitem in group.Elements())
                {
                    dataGroup.Items.Add(new DataItem(dataitem.Attribute("uniqueId").Value,
                                                     dataitem.Attribute("title").Value,
                                                     dataitem.Attribute("imagePath").Value,
                                                     dataitem.Attribute("content").Value,
                                                     dataGroup));
                }

                _datasource.AllGroups.Add(dataGroup);
            }

            return _datasource;
        }
Example #2
0
        public void InitiateMenu()
        {
            _datasource.AllGroups.Clear();

            _datasource = WinAppLibrary.Menu.MenuDataSource.GetDataSrouce();
        }