Item that is used to map samples to tree that supports sub nodes
        /// <summary>
        /// Gets all samples as a tree.
        /// </summary>
        /// <returns>Return all categories, subcategories and samples.</returns>
        public List<TreeItem> GetSamplesAsTree()
        {
            var categories = new List<TreeItem>();

            try
            {
                List<SampleModel> sampleList = new List<SampleModel>();

                foreach (var category in _sampleStructureMap.Categories)
                {
                    var categoryItem = new TreeItem();
                    categoryItem.Name = category.Name;

                    foreach (var subCategory in category.SubCategories)
                    {
                        if (subCategory.ShowGroup)
                        {
                            var subCategoryItem = new TreeItem() { Name = subCategory.Name };
                            categoryItem.Items.Add(subCategoryItem);

                            if (subCategory.Samples != null)
                                foreach (var sample in subCategory.Samples)
                                {
                                    subCategoryItem.Items.Add(sample);
                                }
                        }
                        else
                        {
                            foreach (var sample in sampleList)
                                categoryItem.Items.Add(sample);
                        }
                    }
                    categories.Add(categoryItem);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return categories;
        }
 public SamplesViewController(TreeItem category)
 {
     this.category = category;
 }