Skip to content

Commit 5c602f3

Browse files
committed
Disable unavailable commands
1 parent a637184 commit 5c602f3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

RetailCoder.VBE/UI/Refactorings/RemoveParameters/RemoveParametersView.xaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:removeParameters="clr-namespace:Rubberduck.UI.Refactorings.RemoveParameters"
7+
xmlns:converters="clr-namespace:Rubberduck.UI.Converters"
78
mc:Ignorable="d"
89
d:DesignHeight="300" d:DesignWidth="300">
910
<UserControl.Resources>
11+
<converters:InvertBoolValueConverter x:Key="InvertedBool" />
1012
<removeParameters:ParameterTextDecorationConverter x:Key="ParameterTextDecoration" />
1113
</UserControl.Resources>
1214
<Grid>
@@ -52,6 +54,7 @@
5254
Margin="5,5,5,0"
5355
Padding="5,0"
5456
HorizontalContentAlignment="Left"
57+
IsEnabled="{Binding ElementName=ParameterGrid, Path=SelectedItem.IsRemoved, Converter={StaticResource InvertedBool}}"
5558
Command="{Binding RemoveParameterCommand}"
5659
CommandParameter="{Binding ElementName=ParameterGrid, Path=SelectedItem}">
5760
<StackPanel Orientation="Horizontal">
@@ -64,6 +67,7 @@
6467
Margin="5,5,5,0"
6568
Padding="5,0"
6669
HorizontalContentAlignment="Left"
70+
IsEnabled="{Binding ElementName=ParameterGrid, Path=SelectedItem.IsRemoved}"
6771
Command="{Binding RestoreParameterCommand}"
6872
CommandParameter="{Binding ElementName=ParameterGrid, Path=SelectedItem}">
6973
<StackPanel Orientation="Horizontal">

0 commit comments

Comments
 (0)