Modification Titre tournois
Modification WPF (Ctrl +C) + Selection
This commit is contained in:
@@ -27,13 +27,13 @@
|
||||
</DockPanel>
|
||||
|
||||
<ListView Grid.Row="1" ItemsSource="{Binding Events}" x:Name="EventsList" Margin="0,0,0,5"
|
||||
SelectedItem="{Binding SelectedWpEvent, Mode=TwoWay}">
|
||||
SelectedItem="{Binding SelectedWpEvent, Mode=TwoWay}" >
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Id}" />
|
||||
<TextBlock Margin="5,0,0,0" Text="{Binding Name}" />
|
||||
<TextBlock Margin="5,0,0,0" Text="{Binding Date}" />
|
||||
<TextBlock Margin="5,0,0,0" Text="{Binding Date, StringFormat=dd/MM/yyyy}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
@@ -46,11 +46,12 @@
|
||||
<ColumnDefinition Width="2*"></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ListView Grid.Column="0" ItemsSource="{Binding ElementName=EventsList,Path=SelectedItem.WpBookings}"
|
||||
x:Name="BookingList" IsTextSearchEnabled="True" TextSearch.TextPath="WpUserDto.Name" Margin="2">
|
||||
x:Name="BookingList" IsTextSearchEnabled="True" TextSearch.TextPath="WpUser.Name" Margin="2" KeyUp="Copy">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding WpUser.Name}" />
|
||||
<StackPanel Orientation="Horizontal" >
|
||||
<TextBlock Text="{Binding WpUser.Name}">
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user