<Window x:Uid="PickMembersDialog"
        x:Class="RoslynPad.Roslyn.LanguageServices.PickMembers.PickMembersDialog"
        x:ClassModifier="internal"
        x:Name="dialog"
        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"
        mc:Ignorable="d"
        d:DesignHeight="380"
        d:DesignWidth="460"
        Height="380"
        Width="460"
        MinHeight="380"
        MinWidth="460"
        Title="{Binding ElementName=dialog, Path=PickMembersDialogTitle}"
        FocusManager.FocusedElement="{Binding ElementName=interfaceNameTextBox}"
        ResizeMode="CanResizeWithGrip"
        ShowInTaskbar="False"
        WindowStartupLocation="CenterOwner">
    <Window.Resources>
        <Style TargetType="ListBoxItem">
            <Setter Property="IsTabStop"
                    Value="False" />
        </Style>
        <Thickness x:Key="okCancelButtonPadding">9,2,9,2</Thickness>
        <Thickness x:Key="selectDeselectButtonPadding">9,2,9,2</Thickness>
        <RoutedUICommand x:Key="MoveUp" />
        <RoutedUICommand x:Key="MoveDown" />
    </Window.Resources>
    <Window.CommandBindings>
        <CommandBinding Command="{StaticResource MoveUp}"
                        Executed="MoveUp_Click" />
        <CommandBinding Command="{StaticResource MoveDown}"
                        Executed="MoveDown_Click" />
    </Window.CommandBindings>
    <Window.InputBindings>
        <KeyBinding Key="Up"
                    Modifiers="Alt"
                    Command="{StaticResource MoveUp}" />
        <KeyBinding Key="Down"
                    Modifiers="Alt"
                    Command="{StaticResource MoveDown}" />
    </Window.InputBindings>
    <Grid Margin="11,6,11,11">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <GroupBox x:Uid="MemberSelectionGroupBox"
                  Margin="0, 9, 0, 0"
                  Grid.Row="0"
                  Header="{Binding ElementName=dialog, Path=Title}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <ListBox x:Uid="MemberSelectionList"
                         x:Name="Members"
                         Grid.Column="0"
                         Margin="9"
                         SelectionMode="Single"
                         SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}"
                         PreviewKeyDown="OnListViewPreviewKeyDown"
                         MouseDoubleClick="OnListViewDoubleClick"
                         ItemsSource="{Binding MemberContainers, Mode=TwoWay}">
                    <ListBox.ItemTemplate x:Uid="SelectableMemberListItem">
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <CheckBox x:Uid="SelectableMemberCheckBox"
                                          AutomationProperties.Name="{Binding MemberAutomationText}"
                                          IsChecked="{Binding IsChecked, Mode=TwoWay}"
                                          Width="Auto"
                                          Focusable="False"
                                          AutomationProperties.AutomationId="{Binding MemberName}" />
                                <Image x:Uid="SelectableMemberGlyph"
                                       Margin="8,0,0,0"
                                       Source="{Binding Glyph}" />
                                <TextBlock x:Uid="SelectableMemberName"
                                           Text="{Binding MemberName}" />
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>

                <StackPanel Grid.Column="1">

                    <Button Name="UpButton"
                            AutomationProperties.Name="{Binding MoveUpAutomationText}"
                            Margin="0 9 4 0"
                            IsEnabled="{Binding CanMoveUp, Mode=OneWay}"
                            AutomationProperties.AutomationId="Up"
                            Height="Auto"
                            Width="Auto"
                            Command="{StaticResource MoveUp}"
                            FontFamily="Segoe UI Symbol"
                            Content="" />

                    <Button Name="DownButton"
                            AutomationProperties.Name="{Binding MoveDownAutomationText}"
                            Margin="0 9 4 0"
                            IsEnabled="{Binding CanMoveDown, Mode=OneWay}"
                            AutomationProperties.AutomationId="Down"
                            Height="Auto"
                            Width="Auto"
                            Command="{StaticResource MoveDown}"
                            FontFamily="Segoe UI Symbol"
                            Content="" />

                    <Button x:Uid="SelectAllButton"
                            Content="{Binding ElementName=dialog, Path=SelectAll}"
                            Margin="0 29 4 0"
                            Click="Select_All_Click"
                            Padding="{StaticResource ResourceKey=selectDeselectButtonPadding}"
                            MinWidth="73"
                            MinHeight="21" />
                    <Button x:Uid="DeselectAllButton"
                            Content="{Binding ElementName=dialog, Path=DeselectAll}"
                            Margin="0 9 4 0"
                            Padding="{StaticResource ResourceKey=selectDeselectButtonPadding}"
                            Click="Deselect_All_Click"
                            MinWidth="73"
                            MinHeight="21" />
                </StackPanel>
                <ItemsControl Grid.Row="1"
                              Grid.ColumnSpan="2"
                              ItemsSource="{Binding Options}"
                              IsTabStop="False">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <CheckBox IsChecked="{Binding IsChecked}"
                                      VerticalAlignment="Center"
                                      VerticalContentAlignment="Center"
                                      Margin="8,0,0,5">
                                <TextBlock Text="{Binding Title}"
                                           TextWrapping="Wrap" />
                            </CheckBox>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </Grid>
        </GroupBox>
        <StackPanel Grid.Row="1"
                    HorizontalAlignment="Right"
                    Margin="0, 11, 0, 0"
                    Orientation="Horizontal">
            <Button x:Uid="OkButton"
                    Content="{Binding ElementName=dialog, Path=OK}"
                    Margin="0, 0, 0, 0"
                    Padding="{StaticResource ResourceKey=okCancelButtonPadding}"
                    Click="OK_Click"
                    IsDefault="True"
                    MinWidth="73"
                    MinHeight="21" />
            <Button x:Uid="CancelButton"
                    Content="{Binding ElementName=dialog, Path=Cancel}"
                    Margin="7, 0, 0, 0"
                    Padding="{StaticResource ResourceKey=okCancelButtonPadding}"
                    Click="Cancel_Click"
                    IsCancel="True"
                    MinWidth="73"
                    MinHeight="21" />
        </StackPanel>
    </Grid>
</Window>
