using System.Windows.Controls;
using System.Windows.Controls.Primitives;
namespace Ravi.UI.Silverlight
{
///
/// date picker behavior
///
public class DatePicker : System.Windows.Controls.DatePicker
{
///
///
///
protected override void OnDateValidationError(DatePickerDateValidationErrorEventArgs e)
{
this.Text = this.SelectedDate == null ? null : this.SelectedDate.ToString();
base.OnDateValidationError(e);
}
///
///
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
DatePickerTextBox datePickerTextBox = base.GetTemplateChild(“TextBox”) as DatePickerTextBox;
if (datePickerTextBox != null)
datePickerTextBox.MaxLength = 10;
}
}
}






