<Window x:Uid="ExtractInterfaceDialog"
        x:Class="RoslynPad.Roslyn.LanguageServices.ExtractInterface.ExtractInterfaceDialog"
        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"
        xmlns:roslyn="clr-namespace:RoslynPad.Roslyn"
        mc:Ignorable="d"
        d:DesignHeight="380"
        d:DesignWidth="460"
        Height="380"
        Width="460"
        MinHeight="380"
        MinWidth="460"
        Title="{Binding ElementName=dialog, Path=ExtractInterfaceDialogTitle}"
        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="labelPadding">0, 5, 0, 2</Thickness>
        <Thickness x:Key="okCancelButtonPadding">9,2,9,2</Thickness>
        <Thickness x:Key="selectDeselectButtonPadding">9,2,9,2</Thickness>
        <Thickness x:Key="textboxPadding">2</Thickness>
        <roslyn:GlyphToImageSourceConverter x:Key="GlyphConverter" />
    </Window.Resources>
    <Grid Margin="11,6,11,11">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <Label x:Uid="InterfaceNameLabel"
                   Content="{Binding ElementName=dialog, Path=NewInterfaceName}"
                   Padding="{StaticResource ResourceKey=labelPadding}"
                   Target="{Binding ElementName=interfaceNameTextBox}" />
            <TextBox x:Uid="InterfaceNameTextBox"
                     Text="{Binding InterfaceName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                     Name="interfaceNameTextBox"
                     Padding="{StaticResource ResourceKey=textboxPadding}"
                     GotFocus="SelectAllInTextBox" />
            <Label x:Uid="GeneratedNameLabel"
                   Content="{Binding ElementName=dialog, Path=GeneratedName}"
                   Padding="{StaticResource ResourceKey=labelPadding}" />
            <TextBox x:Uid="GeneratedNameTextBox"
                     Text="{Binding GeneratedName, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
                     IsReadOnly="True"
                     Background="{DynamicResource {x:Static SystemColors.ControlBrush}}"
                     Padding="{StaticResource ResourceKey=textboxPadding}"
                     GotFocus="SelectAllInTextBox" />
            <Label x:Uid="FileNameLabel"
                   Content="{Binding ElementName=dialog, Path=NewFileName}"
                   Padding="{StaticResource ResourceKey=labelPadding}"
                   Target="{Binding ElementName=fileNameTextBox}" />
            <TextBox x:Uid="FileNameTextBox"
                     Text="{Binding FileName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                     Padding="{StaticResource ResourceKey=textboxPadding}"
                     Name="fileNameTextBox"
                     GotFocus="SelectAllInTextBox" />
        </StackPanel>
        <GroupBox x:Uid="MemberSelectionGroupBox"
                  Margin="0, 9, 0, 0"
                  Grid.Row="1"
                  Header="{Binding ElementName=dialog, Path=SelectPublicMembersToFormInterface}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <ListView x:Uid="MemberSelectionList"
                          x:Name="Members"
                          Grid.Column="0"
                          Margin="9"
                          SelectionMode="Extended"
                          PreviewKeyDown="OnListViewPreviewKeyDown"
                          MouseDoubleClick="OnListViewDoubleClick"
                          ItemsSource="{Binding MemberContainers, Mode=TwoWay}">
                    <ListView.ItemTemplate x:Uid="SelectableMemberListItem">
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <CheckBox x:Uid="SelectableMemberCheckBox"
                                          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, Converter={StaticResource GlyphConverter}}" />
                                <TextBlock x:Uid="SelectableMemberName"
                                           Text="{Binding MemberName}" />
                            </StackPanel>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
                <StackPanel Grid.Column="1">
                    <Button x:Uid="SelectAllButton"
                            Content="{Binding ElementName=dialog, Path=SelectAll}"
                            Margin="2, 9, 9, 7"
                            Click="Select_All_Click"
                            Padding="{StaticResource ResourceKey=selectDeselectButtonPadding}"
                            MinWidth="73"
                            MinHeight="21" />
                    <Button x:Uid="DeselectAllButton"
                            Content="{Binding ElementName=dialog, Path=DeselectAll}"
                            Margin="2, 0, 9, 0"
                            Padding="{StaticResource ResourceKey=selectDeselectButtonPadding}"
                            Click="Deselect_All_Click"
                            MinWidth="73"
                            MinHeight="21" />
                </StackPanel>
            </Grid>
        </GroupBox>
        <StackPanel Grid.Row="2"
                    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>
