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;
using System.IO;
using C1.Silverlight.Extended;
using System.ComponentModel.DataAnnotations;

namespace C1Extended_Demo
{
    public partial class PropertyGridValidation : UserControl
    {
        public PropertyGridValidation()
        {
            InitializeComponent();

            var source = new Person();
            _propertyGrid.AvailableEditors.Insert(0, new FileEditor());
            _propertyGrid.PropertyAttributes.Add(new PropertyAttribute()
            {
                MemberName = "Phone",
                Description = "(555)55-5555",
                Editor = new MaskedEditor() { Mask = "(000)00-0000" }
            });
            _propertyGrid.SelectedObject = source;
        }
    }
}
