mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-19 17:29:00 -05:00
FIX Referencing context menu as dynamic resource loses data context somehow.
git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@185 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
@@ -28,10 +28,10 @@
|
||||
</Style>
|
||||
|
||||
|
||||
<!-- The taskbar context menu - the first row is a dummy to show of simple data binding -->
|
||||
<!-- The taskbar context menu - the first row is a dummy to show off simple data binding -->
|
||||
<!--
|
||||
The "shared" directive is needed if we reopen the sample a few times - WPF will otherwise
|
||||
reuse the same context menu again (which will have its DataContext set to the old TaskbarIcon)
|
||||
The "shared" directive is needed if we reopen the sample window a few times - WPF will otherwise
|
||||
reuse the same context menu (which is a resource) again (which will have its DataContext set to the old TaskbarIcon)
|
||||
-->
|
||||
<ContextMenu
|
||||
x:Shared="false"
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
x:Name="tb"
|
||||
VerticalAlignment="Top"
|
||||
IconSource="{Binding Path=SelectedItem.Source, ElementName=iconList, Mode=Default}"
|
||||
ContextMenu="{DynamicResource tbMenu}"
|
||||
ContextMenu="{StaticResource tbMenu}"
|
||||
ToolTipText="{Binding Path=Text, ElementName=txtToolTipText, Mode=Default}"
|
||||
Visibility="{Binding Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=iconVisibility, Mode=Default}"
|
||||
MenuActivation="{Binding Path=SelectedItem, ElementName=lstMenuTrigger, Mode=Default}"
|
||||
|
||||
Reference in New Issue
Block a user