using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace FilteringByCustomTypeSilverlight
{
    public partial class Page : UserControl
    {
        public Page()
        {
            InitializeComponent();

            this.GridView.ItemsSource = GetMessages();
        }

        private IList<Message> GetMessages()
        {
            return new[]
                       {
                           new Message
                               {
                                   Sender = "tom@hanna-barbera.com",
                                   Subject = "Cats are cool",
                                   Size = 100,
                                   Attachment = new Attachment { Name = "Attach1" }
                               },
                           new Message
                               {
                                   Sender = "jerry@hanna-barbera.com",
                                   Subject = "Mice are cool",
                                   Size = 100,
                                   Attachment = new Attachment { Name = "Attach1" }
                               },
                           new Message
                               {
                                   Sender = "spike@hanna-barbera.com",
                                   Subject = "Dogs are cool",
                                   Size = 100,
                                   Attachment = new Attachment { Name = "Attach2" }
                               }
                       };
        }
    }
}
