Sic.Framework/UIDebug/SicUI/Dialog/ItemsSelectDialogView.xaml

43 lines
2.5 KiB
Plaintext
Raw Normal View History

<UserControl x:Class="SicUI.Client.Dialog.ItemsSelectDialogView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SicUI.Client.Dialog"
mc:Ignorable="d"
xmlns:ts="clr-namespace:OpenSEMI.ClientBase.Command;assembly=MECF.Framework.UI.Client"
d:DesignHeight="300" d:DesignWidth="300">
<Grid SnapsToDevicePixels="True">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="350"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<DataGrid Name="SequenceFileList" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" AutoGenerateColumns="False" CanUserAddRows="False"
ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedName}" Width="315" Height="416">
<DataGrid.Columns>
<DataGridTemplateColumn Header="Name" Width="200" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding }" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
<ts:CommandSource.Trigger>
<ts:CommandTriggerGroup>
<ts:EventCommandTrigger RoutedEvent="DataGrid.MouseDoubleClick" CustomParameter="{Binding SelectedItem,ElementName=SequenceFileList}"
Command="{Binding DataContext.ListViewDoubleClick,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
</ts:CommandTriggerGroup>
</ts:CommandSource.Trigger>
</DataGrid>
<StackPanel Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
<Button Content="Select" Command="{Binding SelectCommand}" HorizontalAlignment="Left" Height="35" Width="80" />
<Button Content="Cancel" Command="{Binding CancelCommand}" HorizontalAlignment="Left" Height="35" Width="80" Margin="5,0,0,0" />
</StackPanel>
</Grid>
</Grid>
</UserControl>