Exemple #1
0
        /// <summary>
        /// Method to populate the data
        /// </summary>
        private void PopulateData()
        {
            string itemContent = String.Format("Item Content: {0}\n\n{0}\n\n{0}\n\n{0}\n\n{0}\n\n{0}\n\n{0}", GenerateParagraph(50));

            for (int i = 0; i < 20; i++)
            {
                var group = new SampleDataGroupViewModel("Group" + i,
                                                         "Group # " + (i + 1),
                                                         "Group Subtitle: " + (i + 1),
                                                         "/Assets/SampleImages/Box" + (1 + RNG.Next(10)) + ".png",
                                                         "Description: " + GenerateParagraph(10));
                for (int x = 0; x < (RNG.Next(50) + 1); x++)
                {
                    group.Items.Add(new SampleDataItemViewModel(string.Format("Group-{0}-Item-{1}", i, x),
                                                                "Item # " + (x + 1),
                                                                "Item Subtitle: " + (x + 1),
                                                                "/Assets/SampleImages/Box" + (1 + RNG.Next(10)) + ".png",
                                                                "Description: " + GenerateParagraph(8),
                                                                itemContent,
                                                                group));
                }

                Groups.Add(group);
            }
        }
 public SampleDataItemViewModel(string id, string title, string subtitle, string imagePath, string description, string content, SampleDataGroupViewModel group)
     : base(id, title, subtitle, imagePath, description)
 {
     _content = content;
     _group   = group;
 }