public static IEnumerable <MailFolders> GetData()
        {
            List <MailFolders> data = new List <MailFolders>();
            // add root item
            MailFolders inbox = new MailFolders {
                Name = "Inbox", Source = "../Resources/FolderOpen.png"
            };

            for (int i = 0; i < 2; i++)
            {
                MailFolders folder = new MailFolders {
                    Name = string.Format("Folder{0}", i), Source = "../Resources/FolderOpen.png"
                };

                for (int j = 0; j < 8; j++)
                {
                    folder.Children.Add(new MailFolders {
                        Name = string.Format("{0}.{1}", folder.Name, j), Source = "../Resources/FolderOpen.png"
                    });
                }

                inbox.Children.Add(folder);
            }

            data.Add(inbox);

            return(data);
        }
Beispiel #2
0
        public static IEnumerable<MailFolders> GetData()
        {
            List<MailFolders> data = new List<MailFolders>();
            // add root item
            MailFolders inbox = new MailFolders { Name = "Inbox", Source = "../Resources/FolderOpen.png" };

            for (int i = 0; i < 2; i++)
            {
                MailFolders folder = new MailFolders { Name = string.Format("Folder{0}", i), Source = "../Resources/FolderOpen.png" };

                for (int j = 0; j < 8; j++)
                {
                    folder.Children.Add(new MailFolders { Name = string.Format("{0}.{1}", folder.Name, j), Source = "../Resources/FolderOpen.png" });
                }

                inbox.Children.Add(folder);
            }

            data.Add(inbox);

            return data;
        }
 public Inbox()
 {
     InitializeComponent();
     mail.ItemsSource = MailFolders.GetData();
 }