|
|
|
@ -1,5 +1,6 @@ |
|
|
|
using MultiTerm.Core.ViewModel; |
|
|
|
using MultiTerm.Core.ViewModel; |
|
|
|
using System; |
|
|
|
using System; |
|
|
|
|
|
|
|
using System.Linq; |
|
|
|
using System.Windows.Controls; |
|
|
|
using System.Windows.Controls; |
|
|
|
using System.Windows.Input; |
|
|
|
using System.Windows.Input; |
|
|
|
|
|
|
|
|
|
|
|
@ -61,4 +62,17 @@ public partial class ConsoleView : UserControl |
|
|
|
if (sender is not TextBox textBox) { return; } |
|
|
|
if (sender is not TextBox textBox) { return; } |
|
|
|
textBox.ScrollToEnd(); |
|
|
|
textBox.ScrollToEnd(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void SendableMessageTextBox_TextChanged(object sender, TextChangedEventArgs e) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// more than one change and added length is more than 1 letter |
|
|
|
|
|
|
|
// => suspect change results from inserting an element from the send history or pasted from the clipboard |
|
|
|
|
|
|
|
if (e.Changes.Count >= 1 && e.Changes.First().AddedLength > 1) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// focus the textbox |
|
|
|
|
|
|
|
this.sendableMessageTextBox.Focus(); |
|
|
|
|
|
|
|
// set cursor to end |
|
|
|
|
|
|
|
this.sendableMessageTextBox.CaretIndex = this.sendableMessageTextBox.Text.Length; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |