\r
namespace HandBrakeWPF.Views\r
{\r
+ using System;\r
using System.Windows;\r
+ using System.Windows.Controls;\r
+ using System.Windows.Input;\r
+\r
+ using HandBrakeWPF.Commands;\r
+ using HandBrakeWPF.ViewModels.Interfaces;\r
\r
- /// <summary>\r
- /// Interaction logic for ErrorView.xaml\r
- /// </summary>\r
public partial class ErrorView : Window\r
{\r
- /// <summary>\r
- /// Initializes a new instance of the <see cref="ErrorView"/> class.\r
- /// </summary>\r
public ErrorView()\r
+ { \r
+ this.InitializeComponent();\r
+ this.InputBindings.Add(new InputBinding(new CopyError(this.errorText), new KeyGesture(Key.C, ModifierKeys.Control))); // Copy Error\r
+ }\r
+ }\r
+\r
+ public class CopyError : ICommand\r
+ {\r
+ private readonly TextBox textBlock;\r
+\r
+ public CopyError(TextBox textBlock)\r
{\r
- InitializeComponent();\r
+ this.textBlock = textBlock;\r
}\r
+\r
+ public bool CanExecute(object parameter)\r
+ {\r
+ return true;\r
+ }\r
+\r
+ public void Execute(object parameter)\r
+ {\r
+ if (this.textBlock != null)\r
+ {\r
+ Clipboard.SetText(this.textBlock.Text);\r
+ } \r
+ }\r
+\r
+ public event EventHandler CanExecuteChanged;\r
}\r
}\r