ItemsSelectDialogView.xaml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <UserControl x:Class="VirgoUI.Client.Dialog.ItemsSelectDialogView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:VirgoUI.Client.Dialog"
  7. mc:Ignorable="d"
  8. xmlns:ts="clr-namespace:OpenSEMI.ClientBase.Command"
  9. d:DesignHeight="300" d:DesignWidth="300">
  10. <Grid SnapsToDevicePixels="True">
  11. <Grid Margin="10">
  12. <Grid.RowDefinitions>
  13. <RowDefinition Height="350"/>
  14. <RowDefinition Height="50"/>
  15. </Grid.RowDefinitions>
  16. <DataGrid Name="SequenceFileList" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" AutoGenerateColumns="False" CanUserAddRows="False"
  17. ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedName}" Width="315" Height="416">
  18. <DataGrid.Columns>
  19. <DataGridTemplateColumn Header="Name" Width="200" >
  20. <DataGridTemplateColumn.CellTemplate>
  21. <DataTemplate>
  22. <TextBlock Text="{Binding }" />
  23. </DataTemplate>
  24. </DataGridTemplateColumn.CellTemplate>
  25. </DataGridTemplateColumn>
  26. </DataGrid.Columns>
  27. <ts:CommandSource.Trigger>
  28. <ts:CommandTriggerGroup>
  29. <ts:EventCommandTrigger RoutedEvent="DataGrid.MouseDoubleClick" CustomParameter="{Binding SelectedItem,ElementName=SequenceFileList}"
  30. Command="{Binding DataContext.ListViewDoubleClick,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
  31. </ts:CommandTriggerGroup>
  32. </ts:CommandSource.Trigger>
  33. </DataGrid>
  34. <StackPanel Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
  35. <Button Content="Select" Command="{Binding SelectCommand}" HorizontalAlignment="Left" Height="35" Width="80" />
  36. <Button Content="Cancel" Command="{Binding CancelCommand}" HorizontalAlignment="Left" Height="35" Width="80" Margin="5,0,0,0" />
  37. </StackPanel>
  38. </Grid>
  39. </Grid>
  40. </UserControl>