Skip to content

Commit

Permalink
(chocolateyGH-745) Reorder Context Menu for local and remote source
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Apr 7, 2020
1 parent 445cce7 commit 9396c0e
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions Source/ChocolateyGui.Common.Windows/Resources/Controls.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,8 @@
<ContextMenu x:Key="PackagesContextMenu"
DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}"
d:DataContext="{d:DesignInstance Type=items:PackageViewModel}">
<MenuItem Header="{x:Static properties:Resources.Controls_PackagesContextMenuInstall}" Icon="{StaticResource PrimaryUacIcon}"
Visibility="{Binding IsInstalled, Converter={StaticResource BooleanToVisibility}, ConverterParameter=True}"
Command="{commands:DataContextCommandAdapter Install}" />
<MenuItem Header="{x:Static properties:Resources.Controls_PackagesContextMenuPin}" Icon="{StaticResource TertiaryUacIcon}"
<MenuItem Header="{x:Static properties:Resources.Controls_PackagesContextMenuPin}"
Icon="{StaticResource TertiaryUacIcon}"
Command="{commands:DataContextCommandAdapter Pin}">
<MenuItem.Visibility>
<MultiBinding Converter="{StaticResource BooleanToVisibility}">
Expand All @@ -508,7 +506,8 @@
</MultiBinding>
</MenuItem.Visibility>
</MenuItem>
<MenuItem Header="{x:Static properties:Resources.Controls_PackagesContextMenuUnpin}" Icon="{StaticResource TertiaryUacIcon}"
<MenuItem Header="{x:Static properties:Resources.Controls_PackagesContextMenuUnpin}"
Icon="{StaticResource TertiaryUacIcon}"
Command="{commands:DataContextCommandAdapter Unpin}">
<MenuItem.Visibility>
<MultiBinding Converter="{StaticResource BooleanToVisibility}">
Expand All @@ -517,16 +516,25 @@
</MultiBinding>
</MenuItem.Visibility>
</MenuItem>
<MenuItem Header="{x:Static properties:Resources.Controls_PackagesContextMenuUninstall}" Icon="{StaticResource PrimaryUacIcon}"
Visibility="{Binding IsInstalled, Converter={StaticResource BooleanToVisibility}}"
Command="{commands:DataContextCommandAdapter Uninstall}" />
<MenuItem Header="{x:Static properties:Resources.Controls_PackagesContextMenuReinstall}" Icon="{StaticResource PrimaryUacIcon}"
Visibility="{Binding IsInstalled, Converter={StaticResource BooleanToVisibility}}"
Command="{commands:DataContextCommandAdapter Reinstall}" />
<MenuItem Header="{x:Static properties:Resources.Controls_PackagesContextMenuUpdate}" Icon="{StaticResource PrimaryUacIcon}"
<MenuItem Header="{x:Static properties:Resources.Controls_PackagesContextMenuDetails}"
Command="{commands:DataContextCommandAdapter ViewDetails}" />
<MenuItem Header="{x:Static properties:Resources.Controls_PackagesContextMenuUpdate}"
Icon="{StaticResource PrimaryUacIcon}"
Visibility="{Binding CanUpdate, Converter={StaticResource BooleanToVisibility}}"
Command="{commands:DataContextCommandAdapter Update}" />
<MenuItem Header="{x:Static properties:Resources.Controls_PackagesContextMenuDetails}" Command="{commands:DataContextCommandAdapter ViewDetails}" />
<Separator />
<MenuItem Header="{x:Static properties:Resources.Controls_PackagesContextMenuInstall}"
Icon="{StaticResource PrimaryUacIcon}"
Visibility="{Binding IsInstalled, Converter={StaticResource BooleanToVisibility}, ConverterParameter=True}"
Command="{commands:DataContextCommandAdapter Install}" />
<MenuItem Header="{x:Static properties:Resources.Controls_PackagesContextMenuReinstall}"
Icon="{StaticResource PrimaryUacIcon}"
Visibility="{Binding IsInstalled, Converter={StaticResource BooleanToVisibility}}"
Command="{commands:DataContextCommandAdapter Reinstall}" />
<MenuItem Header="{x:Static properties:Resources.Controls_PackagesContextMenuUninstall}"
Icon="{StaticResource PrimaryUacIcon}"
Visibility="{Binding IsInstalled, Converter={StaticResource BooleanToVisibility}}"
Command="{commands:DataContextCommandAdapter Uninstall}" />
</ContextMenu>

<Style TargetType="{x:Type DataGrid}" BasedOn="{StaticResource {x:Type DataGrid}}">
Expand Down

0 comments on commit 9396c0e

Please sign in to comment.