I have a problem which i can't solve. I wrote an application which works in tray. Everything works fine but when i click right button (on tray icon) context menu open and then i click left button (on menu item) to execute the method, but then the context menu doesn't hide until this method is finish and stay on the top of the screen. Could you tell me how can i hide this context menu after click immediately ? My XAML code for TaskbarIcon:
<tb:TaskbarIcon Name="Tray" IconSource="ico.ico" ToolTipText="text" Visibility="Visible" TrayLeftMouseUp="ShowWindow_Click">
<tb:TaskbarIcon.ContextMenu>
<ContextMenu Name="ContextMenu">
<ContextMenu.Style>
<Style TargetType="{x:Type ContextMenu}">
<Setter Property="ItemsPanel" Value="{StaticResource MenuTPL}"/>
</Style>
</ContextMenu.Style>
<MenuItem x:Name="ShowWindow" Click="ShowWindow_Click" Header="show"></MenuItem>
<MenuItem x:Name="GetPoints" Click="Run_Click" Header="points"></MenuItem>
<MenuItem x:Name="Finish" Click="Zakoncz_Click" Header="exit"></MenuItem>
</ContextMenu>
</tb:TaskbarIcon.ContextMenu>
</tb:TaskbarIcon>