Modification Titre tournois

Modification WPF (Ctrl +C) + Selection
This commit is contained in:
2019-03-13 22:54:39 +01:00
parent 330746b2c6
commit c23a8244da
5 changed files with 54 additions and 11 deletions

View File

@@ -3,15 +3,19 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using LaDOSE.DTO;
using Clipboard = System.Windows.Clipboard;
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
using ListViewItem = System.Windows.Controls.ListViewItem;
using UserControl = System.Windows.Controls.UserControl;
namespace LaDOSE.DesktopApp.Views
{
@@ -27,5 +31,21 @@ namespace LaDOSE.DesktopApp.Views
}
private void Copy(object sender, KeyEventArgs e)
{
if (sender != BookingList) return;
if (e.Key == Key.C && (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
CopySelectedValuesToClipboard();
}
private void CopySelectedValuesToClipboard()
{
var builder = new StringBuilder();
foreach (WPBookingDTO item in BookingList.SelectedItems)
builder.AppendLine(item.WpUser.Name);
Clipboard.SetText(builder.ToString());
}
}
}