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