using MuchInfo.Chart.Data.EnumTypes; using System.Windows.Controls; using System.Windows.Input; namespace MuchInfo.Chart.WPF.Controls.QuickTimeSpan { /// /// TimeSpanButton.xaml 的交互逻辑 /// public partial class TimeSpanButton : UserControl { #region Fields private TimeSpanPicker _parentTimeSpanControl; #endregion Fields #region Constructors /// /// Initializes a new instance of the class. /// /// The text. /// Type of the cycle. /// The parent. public TimeSpanButton(string text, CycleType cycleType, TimeSpanPicker parent) { this.InitializeComponent(); Text = text; CycleType = cycleType; _parentTimeSpanControl = parent; } #endregion Constructors #region Properties #region Public Properties /// /// Gets or sets the type of the cycle. /// /// The type of the cycle. public CycleType CycleType { get; set; } /// /// Gets or sets the text. /// /// The text. public string Text { get { return this.lblMain.Text; } set { this.lblMain.Text = value; } } #endregion Public Properties #endregion Properties #region Methods #region Private Methods /// /// 选择显示区间后执行 /// private void LayoutRoot_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { this._parentTimeSpanControl.UpdateCyleType(this.CycleType); } #endregion Private Methods #endregion Methods } }