<Window
	x:Class="ICSharpCode.ILSpy.ManageAssemblyListsDialog" 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
	xmlns:properties="clr-namespace:ICSharpCode.ILSpy.Properties"
	xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
	Title="{x:Static properties:Resources.ManageAssemblyLists}"
	Style="{DynamicResource DialogWindow}"
	WindowStartupLocation="CenterOwner"
	ResizeMode="CanResizeWithGrip"
	MinWidth="480"
	MinHeight="250"
	Height="350"
	Width="480"
	FocusManager.FocusedElement="{Binding ElementName=listView}">
	<Window.Resources>
		<ContextMenu x:Key="PreconfiguredAssemblyListsMenu" ItemsSource="{Binding PreconfiguredAssemblyLists}" DisplayMemberPath="Name">
			<ContextMenu.ItemContainerStyle>
				<Style TargetType="MenuItem">
					<Setter Property="Command" Value="{Binding DataContext.CreatePreconfiguredAssemblyListCommand, RelativeSource={RelativeSource AncestorType=Window}}" />
					<Setter Property="CommandParameter" Value="{Binding}" />
				</Style>
			</ContextMenu.ItemContainerStyle>
		</ContextMenu>
	</Window.Resources>
	<Grid Margin="12,8">
		<Grid.RowDefinitions>
			<RowDefinition Height="*" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="*" />
			<ColumnDefinition Width="*" />
			<ColumnDefinition Width="*" />
			<ColumnDefinition Width="*" />
			<ColumnDefinition Width="Auto" />
		</Grid.ColumnDefinitions>
		<ListBox Name="listView" Margin="0 8" Grid.ColumnSpan="4" SelectedItem="{Binding SelectedAssemblyList}"
				 SelectionMode="Single" ItemsSource="{Binding AssemblyLists}">
			<b:Interaction.Triggers>
				<b:EventTrigger EventName="MouseDoubleClick">
					<b:InvokeCommandAction Command="{Binding SelectAssemblyListCommand}" />
				</b:EventTrigger>
				<b:KeyTrigger Key="Return" FiredOn="KeyDown">
					<b:InvokeCommandAction Command="{Binding SelectAssemblyListCommand}" />
				</b:KeyTrigger>
				<b:KeyTrigger Key="Delete" FiredOn="KeyDown">
					<b:InvokeCommandAction Command="{Binding DeleteCommand}" CommandParameter="{Binding ., RelativeSource={RelativeSource AncestorType=Window}}" />
				</b:KeyTrigger>
			</b:Interaction.Triggers>
		</ListBox>

		<StackPanel Grid.Column="5" Grid.RowSpan="2" Margin="4, 8">
			<Button Margin="2 2 2 10" Command="{Binding NewCommand}" CommandParameter="{Binding ., RelativeSource={RelativeSource AncestorType=Window}}" Content="{x:Static properties:Resources._New}"/>
			<Button Margin="2" Command="{Binding CloneCommand}" CommandParameter="{Binding ., RelativeSource={RelativeSource AncestorType=Window}}" Content="{x:Static properties:Resources.C_lone}"/>
			<Button Margin="2" Command="{Binding RenameCommand}" CommandParameter="{Binding ., RelativeSource={RelativeSource AncestorType=Window}}" Content="{x:Static properties:Resources.R_ename}"/>
			<Button Margin="2" Command="{Binding DeleteCommand}" CommandParameter="{Binding ., RelativeSource={RelativeSource AncestorType=Window}}" Content="{x:Static properties:Resources.OpenListDialog__Delete}"/>
			<Button Margin="2 10 2 2" Command="{Binding ResetCommand}" CommandParameter="{Binding ., RelativeSource={RelativeSource AncestorType=Window}}" Content="{x:Static properties:Resources._Reset}"/>
		</StackPanel>

		<Button IsCancel="True" Grid.Row="2" Margin="2,0" Content="{x:Static properties:Resources.Close}" />
		<Button Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" Margin="2,0" Content="{x:Static properties:Resources.AddPreconfiguredList}" Click="PreconfiguredAssemblyListsMenuClick" />
	</Grid>
</Window>