public TextBoxAdapter() { textBox = new wpf.System.Windows.Controls.TextBox { BorderThickness = new wpf::System.Windows.Thickness(), Background = wpf::System.Windows.Media.Brushes.Transparent }; textBox.TextChanged += (sender, e) => this.Text = textBox.Text; textBox.SelectionChanged += (sender, e) => { this.CaretIndex = textBox.CaretIndex; this.SelectionStart = textBox.SelectionStart; this.SelectionLength = textBox.SelectionLength; }; }
public TextBoxAdapter() { textBox = new wpf.System.Windows.Controls.TextBox { BorderThickness = new wpf::System.Windows.Thickness(), Background = wpf::System.Windows.Media.Brushes.Transparent }; textBox.TextChanged += (sender, e) => this.Text = textBox.Text; textBox.SelectionChanged += (sender, e) => { this.CaretIndex = textBox.CaretIndex; this.SelectionStart = textBox.SelectionStart; this.SelectionLength = textBox.SelectionLength; }; }