Exemplo n.º 1
0
Arquivo: CText.cs Projeto: Daoting/dt
        static void OnUpdateTimelyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            CText c = (CText)d;

            if (c._tb != null)
            {
                if ((bool)e.NewValue)
                {
                    c._tb.TextChanged += OnUpdateSource;
                }
                else
                {
                    c._tb.TextChanged -= OnUpdateSource;
                }
            }
        }
Exemplo n.º 2
0
Arquivo: CText.cs Projeto: Daoting/dt
        static void OnAcceptsReturnChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            CText c = (CText)d;

            if (c._tb != null)
            {
                if ((bool)e.NewValue)
                {
                    c._tb.AcceptsReturn = true;
                    c._tb.TextWrapping  = TextWrapping.Wrap;
                }
                else
                {
                    c._tb.AcceptsReturn = false;
                    c._tb.TextWrapping  = TextWrapping.NoWrap;
                }
            }
        }