ExtractInterfaceDialog.xaml 11.1 KB
Newer Older
1 2 3 4
<vs:DialogWindow x:Uid="ExtractInterfaceDialog"
             x:Class="Microsoft.VisualStudio.LanguageServices.Implementation.ExtractInterface.ExtractInterfaceDialog"
             x:ClassModifier="internal"
             x:Name="dialog"
J
Jared Parsons 已提交
5
             xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
6 7 8 9
             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" 
J
Jared Parsons 已提交
10
             xmlns:s="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
D
David Poeschl 已提交
11
             xmlns:u="clr-namespace:Microsoft.VisualStudio.LanguageServices.Implementation.Utilities"
12
             xmlns:dest="clr-namespace:Microsoft.VisualStudio.LanguageServices.Implementation.ExtractInterface"
13 14 15 16 17 18 19 20 21
             mc:Ignorable="d" 
             d:DesignHeight="380" d:DesignWidth="460"
             Height="380" Width="460"
             MinHeight="380" MinWidth="460"
             Title="{Binding ElementName=dialog, Path=ExtractInterfaceDialogTitle}"
             HasHelpButton="True"
             FocusManager.FocusedElement="{Binding ElementName=interfaceNameTextBox}"
             ResizeMode="CanResizeWithGrip"
             ShowInTaskbar="False"
D
dpoeschl 已提交
22
             HasDialogFrame="True"
23 24 25 26 27 28 29 30 31 32
             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>
A
Andrew Hall (METAL) 已提交
33
        <Thickness x:Key="radioButtonPadding">2, 0, 2, 0</Thickness>
34
        <u:EnumBoolConverter x:Key="enumBoolConverter" />
35 36 37 38 39 40 41 42 43
    </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" 
D
David Poeschl 已提交
44
                   x:Name="InterfaceNameLabel"
45 46 47
                   Content="{Binding ElementName=dialog, Path=NewInterfaceName}"
                   Padding="{StaticResource ResourceKey=labelPadding}"
                   Target="{Binding ElementName=interfaceNameTextBox}"/>
D
David Poeschl 已提交
48 49
            <TextBox x:Uid="InterfaceNameTextBox"
                     AutomationProperties.LabeledBy="{Binding ElementName=InterfaceNameLabel}"
50 51 52 53 54
                     Text="{Binding InterfaceName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                     Name="interfaceNameTextBox"
                     Padding="{StaticResource ResourceKey=textboxPadding}"
                     GotFocus="SelectAllInTextBox"/>
            <Label x:Uid="GeneratedNameLabel" 
D
David Poeschl 已提交
55
                   x:Name="GeneratedNameLabel" 
56 57 58
                   Content="{Binding ElementName=dialog, Path=GeneratedName}" 
                   Padding="{StaticResource ResourceKey=labelPadding}"/>
            <TextBox x:Uid="GeneratedNameTextBox" 
D
David Poeschl 已提交
59
                     AutomationProperties.LabeledBy="{Binding ElementName=GeneratedNameLabel}"
60 61 62 63 64
                     Text="{Binding GeneratedName, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" 
                     IsReadOnly="True"
                     Background="{DynamicResource {x:Static SystemColors.ControlBrush}}"
                     Padding="{StaticResource ResourceKey=textboxPadding}"
                     GotFocus="SelectAllInTextBox"/>
65 66 67 68

            <GroupBox x:Uid="DestinationSelectionGroupBox"
                      Margin="0, 9, 0, 0"
                      Header="{Binding ElementName=dialog, Path=SelectDestinationFile}">
A
Andrew Hall (METAL) 已提交
69 70
                <Grid
                    Margin="9, 9, 9, 7">
71 72 73 74 75 76 77 78 79 80
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>

                    <RadioButton x:Uid="DestinationCurrentFileSelectionRadioButton"
81
                                 Name="DestinationCurrentFileSelectionRadioButton"
82 83 84
                                 GroupName="FileDestination"
                                 Grid.Row="0"
                                 Grid.ColumnSpan="2" 
A
Andrew Hall (METAL) 已提交
85
                                 Margin="0, 0, 0, 5"
86
                                 Content="{Binding ElementName=dialog, Path=SelectCurrentFileAsDestination}"
A
Andrew Hall (METAL) 已提交
87
                                 Padding="{StaticResource ResourceKey=radioButtonPadding}"
88
                                 IsChecked="{Binding Destination, Converter={StaticResource enumBoolConverter}, ConverterParameter={x:Static dest:InterfaceDestination.CurrentFile}}"
A
Andrew Hall (METAL) 已提交
89
                                 VerticalAlignment="Center"
90 91 92
                                 />

                    <RadioButton x:Uid="DestinationNewFileSelectionRadioButton"
93
                                 Name="DestinationNewFileSelectionRadioButton"
94 95 96 97
                                 GroupName="FileDestination"
                                 Grid.Row="1"
                                 Grid.Column="0"
                                 Content="{Binding ElementName=dialog, Path=SelectNewFileAsDestination}"
98
                                 IsChecked="{Binding Destination, Converter={StaticResource enumBoolConverter}, ConverterParameter={x:Static dest:InterfaceDestination.NewFile}}"
A
Andrew Hall (METAL) 已提交
99 100
                                 Padding="{StaticResource ResourceKey=radioButtonPadding}"
                                 VerticalAlignment="Center"
101 102 103
                                 />

                    <TextBox x:Uid="FileNameTextBox" 
A
Andrew Hall (METAL) 已提交
104
                             AutomationProperties.LabeledBy="{Binding ElementName=DestinationNewFileSelectionRadioButton}"
105 106
                             Text="{Binding FileName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                             Padding="{StaticResource ResourceKey=textboxPadding}"
A
Andrew Hall (METAL) 已提交
107
                             Margin="2, 0, 0, 0"
108 109 110 111 112 113 114
                             Name="fileNameTextBox"
                             IsEnabled="{Binding FileNameEnabled, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
                             GotFocus="SelectAllInTextBox"
                             Grid.Column="1" 
                             Grid.Row="1" />
                </Grid>
            </GroupBox>
115 116
        </StackPanel>
        <GroupBox x:Uid="MemberSelectionGroupBox"
117
                  x:Name="MemberSelectionGroupBox"
118 119 120 121 122 123 124 125
                  Margin="0, 9, 0, 0"
                  Grid.Row="1"
                  Header="{Binding ElementName=dialog, Path=SelectPublicMembersToFormInterface}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
D
David Poeschl 已提交
126
                <u:AutomationDelegatingListView x:Uid="MemberSelectionList"
127
                          x:Name="Members"
128
                          AutomationProperties.LabeledBy="{Binding ElementName=MemberSelectionGroupBox}"
129 130 131 132 133 134
                          Grid.Column="0"
                          Margin="9"
                          SelectionMode="Extended"
                          PreviewKeyDown="OnListViewPreviewKeyDown"
                          MouseDoubleClick="OnListViewDoubleClick"
                          ItemsSource="{Binding MemberContainers, Mode=TwoWay}">
D
David Poeschl 已提交
135
                    <u:AutomationDelegatingListView.ItemTemplate x:Uid="SelectableMemberListItem">
136 137
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
D
David Poeschl 已提交
138
                                <CheckBox x:Uid="SelectableMemberCheckBox"
139
                                          AutomationProperties.Name="{Binding SymbolAutomationText}"
140 141 142
                                          IsChecked="{Binding IsChecked, Mode=TwoWay}" 
                                          Width="Auto"
                                          Focusable="False"
143
                                          AutomationProperties.AutomationId="{Binding SymbolName}">
144 145 146 147 148
                                </CheckBox>
                                <Image x:Uid="SelectableMemberGlyph" 
                                       Margin="8,0,0,0"
                                               Source="{Binding Glyph}"/>
                                <TextBlock x:Uid="SelectableMemberName" 
149
                                                   Text="{Binding SymbolName}"/>
150 151
                            </StackPanel>
                        </DataTemplate>
D
David Poeschl 已提交
152 153
                    </u:AutomationDelegatingListView.ItemTemplate>
                </u:AutomationDelegatingListView>
154 155
                <StackPanel Grid.Column="1">
                    <Button x:Uid="SelectAllButton"
156
                            Name="SelectAllButton"
157 158 159 160 161 162 163
                            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"
164
                            Name="DeselectAllButton"
165 166 167 168 169 170 171 172 173 174 175 176 177 178
                            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" 
179
                    Name="OKButton"
180 181 182 183 184 185 186 187
                    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" 
188
                    Name="CancelButton"
189 190 191 192 193 194 195 196 197
                    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>
J
Jared Parsons 已提交
198
</vs:DialogWindow>