menu issue fix

This commit is contained in:
stax76
2021-12-01 14:09:31 +01:00
parent 8677efdb06
commit bde4849465
2 changed files with 9 additions and 8 deletions

View File

@@ -165,9 +165,7 @@ The command palette based playlist showing my favorite artist of the stax record
![Playlist](docs/img/Playlist.png) ![Playlist](docs/img/Playlist.png)
Related apps List of my apps
------------ ---------------
Find a list of related apps:
https://stax76.github.io/frankskare https://stax76.github.io/frankskare

View File

@@ -666,10 +666,12 @@ namespace mpvnet
foreach (CommandItem item in items) foreach (CommandItem item in items)
{ {
if (string.IsNullOrEmpty(item.Path)) var tempItem = item;
if (string.IsNullOrEmpty(tempItem.Path))
continue; continue;
var menuItem = MenuHelp.Add(ContextMenu.Items, item.Path); var menuItem = MenuHelp.Add(ContextMenu.Items, tempItem.Path);
if (menuItem != null) if (menuItem != null)
{ {
@@ -679,7 +681,8 @@ namespace mpvnet
MenuAutoResetEvent.WaitOne(); MenuAutoResetEvent.WaitOne();
System.Windows.Application.Current.Dispatcher.Invoke( System.Windows.Application.Current.Dispatcher.Invoke(
DispatcherPriority.Background, new Action(delegate { })); DispatcherPriority.Background, new Action(delegate { }));
Core.Command(item.Command); if (!string.IsNullOrEmpty(tempItem.Command))
Core.Command(tempItem.Command);
}); });
} }
catch (Exception ex) { catch (Exception ex) {
@@ -687,7 +690,7 @@ namespace mpvnet
} }
}; };
menuItem.InputGestureText = item.Input; menuItem.InputGestureText = tempItem.Input;
} }
} }
} }