Skip to content

Commit 17d4cc3

Browse files
committed
Context menu works.
1 parent 9fff7cd commit 17d4cc3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

RetailCoder.VBE/UI/CodeExplorer/CodeExplorerControl.xaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
xmlns:themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
1111
ResxExtension.DefaultResxName="Rubberduck.UI.RubberduckUI"
1212
Language="{UICulture}"
13+
Name="CodeExplorer"
1314
mc:Ignorable="d"
1415
d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance codeExplorer:CodeExplorerViewModel}">
1516
<UserControl.Resources>
@@ -64,17 +65,19 @@
6465
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
6566
<Setter Property="ContextMenu">
6667
<Setter.Value>
67-
<ContextMenu>
68+
<ContextMenu DataContext="{Binding DataContext, Source={x:Reference CodeExplorer}}">
6869
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Refresh}"
6970
Command="{Binding RefreshCommand}">
7071
<MenuItem.Icon>
7172
<Image Source="../../Resources/arrow-circle-double.png" />
7273
</MenuItem.Icon>
7374
</MenuItem>
7475
<Separator />
75-
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Rename}" Command="{Binding RenameCommand}" />
76+
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=Rename}"
77+
Command="{Binding RenameCommand}" />
7678
<Separator />
77-
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CodeExplorer_ContextMenu_AddTestModuleText}" Command="{Binding AddTestModuleCommand}" />
79+
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CodeExplorer_ContextMenu_AddTestModuleText}"
80+
Command="{Binding AddTestModuleCommand}" />
7881
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CodeExplorer_ContextMenu_AddStdModuleText}" Command="{Binding AddStdModuleCommand}" />
7982
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CodeExplorer_ContextMenu_AddClassModuleText}" Command="{Binding AddClsModuleCommand}" />
8083
<MenuItem Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=CodeExplorer_ContextMenu_AddFormText}" Command="{Binding AddFormCommand}" />
@@ -385,7 +388,8 @@
385388
ItemContainerStyle="{StaticResource ShinyTreeView}"
386389
HorizontalContentAlignment="Stretch"
387390
MouseDoubleClick="TreeView_OnMouseDoubleClick"
388-
Style="{StaticResource CodeExplorerTreeViewStyle}">
391+
Style="{StaticResource CodeExplorerTreeViewStyle}"
392+
DataContext="{Binding ElementName=CodeExplorer, Path=DataContext}">
389393
<i:Interaction.Behaviors>
390394
<controls:BindableSelectedItemBehavior SelectedItem="{Binding SelectedItem, Mode=TwoWay}" />
391395
</i:Interaction.Behaviors>

0 commit comments

Comments
 (0)