mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-02-16 11:08:30 -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>
|
</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
|
The "shared" directive is needed if we reopen the sample window a few times - WPF will otherwise
|
||||||
reuse the same context menu again (which will have its DataContext set to the old TaskbarIcon)
|
reuse the same context menu (which is a resource) again (which will have its DataContext set to the old TaskbarIcon)
|
||||||
-->
|
-->
|
||||||
<ContextMenu
|
<ContextMenu
|
||||||
x:Shared="false"
|
x:Shared="false"
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
x:Name="tb"
|
x:Name="tb"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
IconSource="{Binding Path=SelectedItem.Source, ElementName=iconList, Mode=Default}"
|
IconSource="{Binding Path=SelectedItem.Source, ElementName=iconList, Mode=Default}"
|
||||||
ContextMenu="{DynamicResource tbMenu}"
|
ContextMenu="{StaticResource tbMenu}"
|
||||||
ToolTipText="{Binding Path=Text, ElementName=txtToolTipText, Mode=Default}"
|
ToolTipText="{Binding Path=Text, ElementName=txtToolTipText, Mode=Default}"
|
||||||
Visibility="{Binding Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=iconVisibility, Mode=Default}"
|
Visibility="{Binding Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=iconVisibility, Mode=Default}"
|
||||||
MenuActivation="{Binding Path=SelectedItem, ElementName=lstMenuTrigger, Mode=Default}"
|
MenuActivation="{Binding Path=SelectedItem, ElementName=lstMenuTrigger, Mode=Default}"
|
||||||
|
|||||||
Reference in New Issue
Block a user