Sysnet.TouchScreen/AppCode/IntervalTextBox.cs

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace Sysnet.TouchScreen
{
    /// <summary>
    /// A specific TextBox for page interval
    /// </summary>
    public class IntervalTextBox : TextBox
    {

        #region Properties

        #region IsValidInterval

        public static DependencyProperty IsValidIntervalProperty = DependencyProperty.RegisterAttached(
            "IsValidInterval", typeof(bool), typeof(IntervalTextBox),
            new FrameworkPropertyMetadata(true));

        public bool IsValidInterval
        {
            get { return (bool)GetValue(IntervalTextBox.IsValidIntervalProperty); }
            set { SetValue(IntervalTextBox.IsValidIntervalProperty, value); }
        }

        #endregion

        #region SelectAllText

        public static DependencyProperty SelectAllTextProperty = DependencyProperty.RegisterAttached(
            "SelectAllText", typeof(bool), typeof(IntervalTextBox),
            new FrameworkPropertyMetadata(false));

        public bool SelectAllText
        {
            get { return (bool)GetValue(IntervalTextBox.SelectAllTextProperty); }
            set { SetValue(IntervalTextBox.SelectAllTextProperty, value); }
        }

        #endregion

        #endregion



        protected override void OnGotKeyboardFocus(System.Windows.Input.KeyboardFocusChangedEventArgs e)
        {
            base.OnGotKeyboardFocus(e);

            if ((bool)GetValue(IntervalTextBox.SelectAllTextProperty))
                this.SelectAll();
        }

        protected override void OnGotMouseCapture(System.Windows.Input.MouseEventArgs e)
        {
后面还有 7 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。