Fixed text element selection when toggling single/multiline state

This commit is contained in:
Thorsten Sommer 2023-02-16 20:41:03 +01:00
parent 618cfb8942
commit 795615756f
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 11 additions and 1 deletions

View File

@ -2,5 +2,5 @@
public static class Version public static class Version
{ {
public static string Text => $"v0.9.6 (2023-02-15), .NET {Environment.Version}"; public static string Text => $"v0.9.7 (2023-02-16), .NET {Environment.Version}";
} }

View File

@ -222,6 +222,16 @@ public partial class TextElements : UserControl
// Reload the text elements: // Reload the text elements:
await this.LoadTextElements(); await this.LoadTextElements();
// Re-select the text element:
foreach (ListViewItem item in this.listTextElements.Items)
{
if ((int)item.Tag == this.currentTextElement.Id)
{
item.Selected = true;
break;
}
}
} }
private async void listTextElements_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) private async void listTextElements_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)