Skip to content

Commit e7b50d4

Browse files
committed
Closes #3489
1 parent 0b26a8d commit e7b50d4

File tree

2 files changed

+39
-6
lines changed

2 files changed

+39
-6
lines changed

RetailCoder.VBE/UI/About/AboutControl.xaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
xmlns:about="clr-namespace:Rubberduck.UI.About"
77
mc:Ignorable="d"
88
d:DesignWidth="499"
9-
d:DataContext="{d:DesignInstance {x:Type about:AboutControlViewModel}, IsDesignTimeCreatable=False}">
9+
d:DataContext="{d:DesignInstance {x:Type about:AboutControlViewModel}, IsDesignTimeCreatable=False}"
10+
KeyDown="OnKeyDownHandler" >
1011
<UserControl.Resources>
1112
<BitmapImage x:Key="Ducky" UriSource="../../Resources/AboutBanner.png" />
1213
<BitmapImage x:Key="RD" UriSource="../../Resources/Rubberduck.png" />
@@ -22,10 +23,19 @@
2223
<RowDefinition Height="64" />
2324
</Grid.RowDefinitions>
2425

25-
<Border Grid.Column="0" Grid.Row="0" Background="White" Margin="5,5,0,0">
26-
<TextBlock Margin="5,10,5,10" Text="{Binding Version}" Foreground="Black"
27-
FontWeight="Bold" FontSize="14"
28-
VerticalAlignment="Top" HorizontalAlignment="Left" />
26+
<Border Grid.Column="0" Grid.Row="0" Background="White" Margin="5,5,0,0"
27+
MouseLeftButtonDown="CopyVersionInfo_MouseLeftButtonDown">
28+
<StackPanel>
29+
<TextBlock x:Name="Version"
30+
Margin="5,10,5,0" Text="{Binding Version}" Foreground="Black"
31+
FontWeight="Bold" FontSize="14"
32+
VerticalAlignment="Center" HorizontalAlignment="Center"/>
33+
<Label Name="CopyVersionInfo"
34+
Foreground="Gray"
35+
FontSize="8"
36+
HorizontalAlignment="Center"
37+
Content="Click here to copy version info to clipboard."/>
38+
</StackPanel>
2939
</Border>
3040

3141
<Border Grid.Column="1" Grid.Row="0" Background="White" Margin="0,5,5,0">

RetailCoder.VBE/UI/About/AboutControl.xaml.cs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
namespace Rubberduck.UI.About
1+
using System.Windows;
2+
using System.Windows.Input;
3+
4+
namespace Rubberduck.UI.About
25
{
36
/// <summary>
47
/// Interaction logic for AboutControl.xaml
@@ -9,5 +12,25 @@ public AboutControl()
912
{
1013
InitializeComponent();
1114
}
15+
16+
private void OnKeyDownHandler(object sender, KeyEventArgs e)
17+
{
18+
bool isControlCPressed = (Keyboard.IsKeyDown(Key.C) && (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)));
19+
if (isControlCPressed)
20+
{
21+
CopyVersionInfoToClipboard();
22+
}
23+
}
24+
25+
private void CopyVersionInfoToClipboard()
26+
{
27+
Clipboard.SetText(this.Version.Text);
28+
System.Windows.MessageBox.Show("Version information copied to clipboard.", "Copy successfull");
29+
}
30+
31+
private void CopyVersionInfo_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
32+
{
33+
CopyVersionInfoToClipboard();
34+
}
1235
}
1336
}

0 commit comments

Comments
 (0)