File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
RetailCoder.VBE/UI/Refactorings/RemoveParameters Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 31
31
<ListView .ItemTemplate>
32
32
<DataTemplate >
33
33
<TextBlock Text =" {Binding Name}"
34
- TextDecorations =" {Binding IsRemoved, Converter={StaticResource ParameterTextDecoration}}"
35
- MouseDown =" TextBlock_MouseDown" />
34
+ TextDecorations =" {Binding IsRemoved, Converter={StaticResource ParameterTextDecoration}}" />
36
35
</DataTemplate >
37
36
</ListView .ItemTemplate>
37
+ <ListView .ItemContainerStyle>
38
+ <Style TargetType =" ListViewItem" >
39
+ <EventSetter Event =" MouseDoubleClick" Handler =" ListViewItem_MouseDoubleClick" />
40
+ </Style >
41
+ </ListView .ItemContainerStyle>
38
42
</ListView >
39
43
40
44
<Grid HorizontalAlignment =" Right"
Original file line number Diff line number Diff line change 1
- using System . Windows . Input ;
1
+ using System . Windows . Controls ;
2
+ using System . Windows . Input ;
2
3
using Rubberduck . Refactorings . RemoveParameters ;
3
4
4
5
namespace Rubberduck . UI . Refactorings . RemoveParameters
@@ -12,11 +13,11 @@ public RemoveParametersView()
12
13
13
14
private RemoveParametersViewModel ViewModel => ( RemoveParametersViewModel ) DataContext ;
14
15
15
- private void TextBlock_MouseDown ( object sender , MouseButtonEventArgs e )
16
+ private void ListViewItem_MouseDoubleClick ( object sender , MouseButtonEventArgs e )
16
17
{
17
- if ( e . ClickCount != 2 ) { return ; }
18
+ var item = ( ListViewItem ) sender ;
19
+ var target = ( Parameter ) item . Content ;
18
20
19
- var target = ( Parameter ) ParameterGrid . SelectedItem ;
20
21
if ( target . IsRemoved )
21
22
{
22
23
ViewModel . RestoreParameterCommand . Execute ( target ) ;
You can’t perform that action at this time.
0 commit comments