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)
Related apps
------------
Find a list of related apps:
List of my apps
---------------
https://stax76.github.io/frankskare

View File

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