#region [ Using namespaces ]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;
using AFC.WS.UI.Common;
using Microsoft.Windows.Controls;
using System.Windows.Controls.Primitives;
#endregion
namespace AFC.WS.UI.CommonControls
{
[TemplatePart(Name = TimePicker.ElementHourTextBox, Type = typeof(TextBox))]
[TemplatePart(Name = TimePicker.ElementMinuteTextBox, Type = typeof(TextBox))]
[TemplatePart(Name = TimePicker.ElementSecondTextBox, Type = typeof(TextBox))]
[TemplatePart(Name = TimePicker.ElementIncrementButton, Type = typeof(RepeatButton))]
[TemplatePart(Name = TimePicker.ElementDecrementButton, Type = typeof(RepeatButton))]
public partial class TimePicker : UserControl, ICommonEdit
{
#region [ Constants ]
private const string ElementHourTextBox = "PART_HourTextBox";
private const string ElementMinuteTextBox = "PART_MinuteTextBox";
private const string ElementSecondTextBox = "PART_SecondTextBox";
private const string ElementIncrementButton = "PART_IncrementButton";
private const string ElementDecrementButton = "PART_DecrementButton";
private static TimeSpan MinValidTime = new TimeSpan(0, 0, 0);
private static TimeSpan MaxValidTime = new TimeSpan(23, 59, 59);
private TextBox selectedTextBox = null;
#endregion
#region [ Staic Constructor ]
static TimePicker()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(TimePicker), new FrameworkPropertyMetadata(typeof(TimePicker)));
}
#endregion
#region [ Constructor ]
public TimePicker()
{
SelectedTime = DateTime.Now.TimeOfDay;
}
#endregion Ctor
#region [ Data ]
private TextBox hourTextBox;
private TextBox minuteTextBox;
private TextBox secondTextBox;
private RepeatButton incrementButton;
private RepeatButton decrementButton;
#endregion Data
#region [ Public Properties