Hi,
ich versuche ein Programm mit einem Taskbar-Icon zu erstellen (
WPF NotifyIcon Control)
Hier der xaml Code für das Window:
XML-Daten
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16:
| <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:tb="http://www.hardcodet.net/taskbar" xmlns:local="clr-namespace:MyApp"> <ContextMenu x:Shared="false" x:Key="MyContextMenu"> <MenuItem Name="ExitApplication" Header="Beenden" /> </ContextMenu> <tb:TaskbarIcon x:Key="MyNotifyIcon" IconSource="/MyApp;component/Resources/exe-icon-48x48.ico" ContextMenu="{StaticResource MyContextMenu}">
</tb:TaskbarIcon>
</ResourceDictionary> |
Wie kann ich den MenuItems jetzt Methoden der Hauptklasse (MyApp) zuordnen?
In den Beispielen dich ich gefunden habe, wurde mit ICommand gearbeitet, aber daraus werde ich nicht schlau...
Kann mir jemand Helfen?
Gruß