Beispiel #1
0
        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;
                }
            }
        }
Beispiel #2
0
        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;
                }
            }
        }