diff --git a/MultiTerm.Core/ViewModel/CommunicationDataViewModel.cs b/MultiTerm.Core/ViewModel/CommunicationDataViewModel.cs
index 0330a9f..2289604 100644
--- a/MultiTerm.Core/ViewModel/CommunicationDataViewModel.cs
+++ b/MultiTerm.Core/ViewModel/CommunicationDataViewModel.cs
@@ -98,7 +98,11 @@ public partial class CommunicationDataViewModel : ObservableObject
// set new newline separator type and overwrite data collection (triggers property changed)
this.currentReceiveNewlineSeparatorType = (NewlineSeparatorType)receiveNewlineSeparatorType;
+ // update collection, invoke ui thread if necessary
+ ContextHelpers.InvokeIfNecessary(this.uiContext, (Action)delegate
+ {
this.ReceivedData = ReorderDataCollection(this.ReceivedData, this.currentReceiveNewlineSeparatorType);
+ });
}
if (sendNewlineSeparatorType != null)
{
@@ -107,7 +111,11 @@ public partial class CommunicationDataViewModel : ObservableObject
// set new newline separator type and overwrite data collection (triggers property changed)
this.currentSentNewlineSeparatorType = (NewlineSeparatorType)sendNewlineSeparatorType;
+ // update collection, invoke ui thread if necessary
+ ContextHelpers.InvokeIfNecessary(this.uiContext, (Action)delegate
+ {
this.SentData = ReorderDataCollection(this.SentData, this.currentSentNewlineSeparatorType);
+ });
}
}
diff --git a/MultiTerm.Protocols/Serial/SerialProtocolSettingsViewModel.cs b/MultiTerm.Protocols/Serial/SerialProtocolSettingsViewModel.cs
index e79b671..28bb498 100644
--- a/MultiTerm.Protocols/Serial/SerialProtocolSettingsViewModel.cs
+++ b/MultiTerm.Protocols/Serial/SerialProtocolSettingsViewModel.cs
@@ -35,6 +35,11 @@ public partial class SerialProtocolSettingsViewModel : ProtocolSettingsViewModel
private void ReloadComPorts()
{
this.ComPorts = SerialProtocol.GetPortNames();
+ // select first COM port, if none is selected yet and there are some available
+ if (String.IsNullOrEmpty(this.PortName) && this.ComPorts.Any())
+ {
+ this.PortName = this.ComPorts.First();
+ }
}
public SerialProtocolSettingsViewModel(IMessenger messenger) : base(messenger)
diff --git a/MultiTerm.Wpf.CustomControl/MultiFormatTextBox/MultiFormatTextBox.cs b/MultiTerm.Wpf.CustomControl/MultiFormatTextBox/MultiFormatTextBox.cs
index 92b08a6..f201842 100644
--- a/MultiTerm.Wpf.CustomControl/MultiFormatTextBox/MultiFormatTextBox.cs
+++ b/MultiTerm.Wpf.CustomControl/MultiFormatTextBox/MultiFormatTextBox.cs
@@ -105,9 +105,14 @@ public class MultiFormatTextBox : Control
private static void OnCurrentMultiFormatStringChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
// extract instance and guard null
- // if (d is not MultiFormatTextBox mftb) { return; }
+ if (d is not MultiFormatTextBox mftb) { return; }
+ if (e.NewValue is not MultiFormatString newString) { return; }
- // nothing to do
+ // new value is an empty string => clear
+ if(newString.FormatValuePairs.Count == 0)
+ {
+ mftb.richTextBox!.Document.Blocks.Clear();
+ }
}
diff --git a/MultiTerm.Wpf/View/SendReceiveView.xaml b/MultiTerm.Wpf/View/SendReceiveView.xaml
index 0e30f20..fe74c05 100644
--- a/MultiTerm.Wpf/View/SendReceiveView.xaml
+++ b/MultiTerm.Wpf/View/SendReceiveView.xaml
@@ -71,7 +71,7 @@
-
+
diff --git a/MultiTerm.Wpf/View/SettingsView/SerialSettingsView.xaml b/MultiTerm.Wpf/View/SettingsView/SerialSettingsView.xaml
index 427e56e..ac72c98 100644
--- a/MultiTerm.Wpf/View/SettingsView/SerialSettingsView.xaml
+++ b/MultiTerm.Wpf/View/SettingsView/SerialSettingsView.xaml
@@ -43,7 +43,7 @@
-
+