Skip to content

Commit 1990226

Browse files
Fix item can't be unselected after editing Location
1 parent cca10ca commit 1990226

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ private void EditProgramSource(ProgramSource selectedProgramSource)
174174
{
175175
var vm = new AddProgramSourceViewModel(context, _settings, selectedProgramSource);
176176
var add = new AddProgramSource(vm);
177+
int selectedIndex = programSourceView.SelectedIndex;
178+
// https://stackoverflow.com/questions/16789360/wpf-listbox-items-with-changing-hashcode
179+
// Or it can't be unselected after changing Location
180+
programSourceView.UnselectAll();
177181
if (add.ShowDialog() ?? false)
178182
{
179183
if (selectedProgramSource.Enabled)
@@ -188,6 +192,7 @@ private void EditProgramSource(ProgramSource selectedProgramSource)
188192
}
189193
ReIndexing();
190194
}
195+
programSourceView.SelectedIndex = selectedIndex;
191196
}
192197
}
193198

0 commit comments

Comments
 (0)