|
| 1 | +<UserControl x:Class="Microsoft.CodeAnalysis.Editor.InlineRename.Adornment.InlineRenameAdornment" |
| 2 | + x:ClassModifier="internal" |
| 3 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 4 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 5 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 6 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 7 | + xmlns:local="clr-namespace:Microsoft.CodeAnalysis.Editor.InlineRename.Adornment" |
| 8 | + xmlns:rename="clr-namespace:Microsoft.CodeAnalysis.Editor.Implementation.InlineRename" |
| 9 | + xmlns:imaging="clr-namespace:Microsoft.VisualStudio.Imaging;assembly=Microsoft.VisualStudio.Imaging" |
| 10 | + xmlns:imagecatalog="clr-namespace:Microsoft.VisualStudio.Imaging;assembly=Microsoft.VisualStudio.ImageCatalog" |
| 11 | + mc:Ignorable="d" |
| 12 | + d:DesignHeight="450" d:DesignWidth="800" |
| 13 | + MinWidth="200" |
| 14 | + x:Name="control" |
| 15 | + KeyDown="Adornment_KeyDown" |
| 16 | + MouseDown="Adornment_ConsumeMouseEvent" |
| 17 | + MouseUp="Adornment_ConsumeMouseEvent" |
| 18 | + GotKeyboardFocus="Adornment_GotKeyboardFocus" |
| 19 | + Focusable="False" |
| 20 | + UseLayoutRounding="True" |
| 21 | + Background="{DynamicResource {x:Static rename:InlineRenameColors.BackgroundBrushKey}}"> |
| 22 | + |
| 23 | + <UserControl.Resources> |
| 24 | + <ResourceDictionary> |
| 25 | + <ResourceDictionary.MergedDictionaries> |
| 26 | + <ResourceDictionary Source="../InlineRenameColors.xaml"/> |
| 27 | + </ResourceDictionary.MergedDictionaries> |
| 28 | + |
| 29 | + <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/> |
| 30 | + |
| 31 | + <SolidColorBrush x:Key="ForegroundText" Color="{DynamicResource {x:Static rename:InlineRenameColors.SystemCaptionTextColorKey}}"/> |
| 32 | + |
| 33 | + <Style TargetType="CheckBox"> |
| 34 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static rename:InlineRenameColors.CheckBoxTextBrushKey}}"/> |
| 35 | + </Style> |
| 36 | + |
| 37 | + <Style TargetType="TextBlock"> |
| 38 | + <Setter Property="Foreground" Value="{StaticResource ForegroundText}"/> |
| 39 | + </Style> |
| 40 | + </ResourceDictionary> |
| 41 | + </UserControl.Resources> |
| 42 | + |
| 43 | + <Border |
| 44 | + Background="{DynamicResource {x:Static rename:InlineRenameColors.BackgroundBrushKey}}" |
| 45 | + BorderThickness="1" |
| 46 | + BorderBrush="{DynamicResource {x:Static rename:InlineRenameColors.ButtonBorderBrush}}" > |
| 47 | + <StackPanel Orientation="Vertical" Margin="5" > |
| 48 | + <Grid Margin="0 0 0 10"> |
| 49 | + <Grid.ColumnDefinitions> |
| 50 | + <ColumnDefinition Width="*" /> |
| 51 | + <ColumnDefinition Width="22" /> |
| 52 | + </Grid.ColumnDefinitions> |
| 53 | + |
| 54 | + |
| 55 | + <TextBox |
| 56 | + Grid.Column="0" |
| 57 | + x:Name="IdentifierTextBox" |
| 58 | + Text="{Binding IdentifierText, UpdateSourceTrigger=PropertyChanged}" |
| 59 | + GotFocus="IdentifierTextBox_GotFocus" |
| 60 | + HorizontalAlignment="Stretch" /> |
| 61 | + |
| 62 | + <!-- Expand/Collapse button and glyph --> |
| 63 | + <Button x:Name="ToggleExpandButton" Grid.Column="1" Click="ToggleExpand" Background="Transparent"> |
| 64 | + <Button.Style> |
| 65 | + <Style TargetType="Button"> |
| 66 | + <Setter Property="Template"> |
| 67 | + <Setter.Value> |
| 68 | + <ControlTemplate TargetType="Button"> |
| 69 | + <Border Name="border" |
| 70 | + BorderThickness="1" |
| 71 | + BorderBrush="{DynamicResource {x:Static rename:InlineRenameColors.BackgroundBrushKey}}" |
| 72 | + Background="{TemplateBinding Background}"> |
| 73 | + <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /> |
| 74 | + </Border> |
| 75 | + <ControlTemplate.Triggers> |
| 76 | + <Trigger Property="IsMouseOver" Value="True"> |
| 77 | + <Setter TargetName="border" Property="BorderBrush" Value="{DynamicResource {x:Static rename:InlineRenameColors.ButtonBorderBrush}}" /> |
| 78 | + </Trigger> |
| 79 | + </ControlTemplate.Triggers> |
| 80 | + </ControlTemplate> |
| 81 | + </Setter.Value> |
| 82 | + </Setter> |
| 83 | + </Style> |
| 84 | + </Button.Style> |
| 85 | + <imaging:CrispImage Grid.Column="0"> |
| 86 | + <imaging:CrispImage.Style> |
| 87 | + <Style TargetType="imaging:CrispImage"> |
| 88 | + <Style.Triggers> |
| 89 | + <DataTrigger Binding="{Binding IsCollapsed}" Value="True"> |
| 90 | + <Setter Property="Moniker" Value="{x:Static imagecatalog:KnownMonikers.ExpandDown}" /> |
| 91 | + </DataTrigger> |
| 92 | + |
| 93 | + <DataTrigger Binding="{Binding IsCollapsed}" Value="False"> |
| 94 | + <Setter Property="Moniker" Value="{x:Static imagecatalog:KnownMonikers.CollapseUp}" /> |
| 95 | + </DataTrigger> |
| 96 | + </Style.Triggers> |
| 97 | + </Style> |
| 98 | + </imaging:CrispImage.Style> |
| 99 | + </imaging:CrispImage> |
| 100 | + </Button> |
| 101 | + </Grid> |
| 102 | + |
| 103 | + <StackPanel Orientation="Vertical" Visibility="{Binding IsExpanded, Converter={StaticResource BooleanToVisibilityConverter}}"> |
| 104 | + <CheckBox Content="{Binding ElementName=control, Path=RenameOverloads}" Margin="0,5,0,0" IsChecked="{Binding Path=RenameOverloadFlag, Mode=TwoWay}" |
| 105 | + Name="OverloadsCheckbox" Visibility="{Binding RenameOverloadsVisibility}" IsEnabled="{Binding IsRenameOverloadsEditable}" /> |
| 106 | + <CheckBox Name="CommentsCheckbox" Content="{Binding ElementName=control, Path=SearchInComments}" Margin="0,5,0,0" IsChecked="{Binding Path=RenameInCommentsFlag, Mode=TwoWay}" /> |
| 107 | + <CheckBox Name="StringsCheckbox" Content="{Binding ElementName=control, Path=SearchInStrings}" Margin="0,5,0,0" IsChecked="{Binding Path=RenameInStringsFlag, Mode=TwoWay}" /> |
| 108 | + <CheckBox Name="FileRenameCheckbox" |
| 109 | + Content="{Binding Path=FileRenameString}" |
| 110 | + Margin="0,5,0,0" |
| 111 | + IsChecked="{Binding Path=RenameFileFlag, Mode=TwoWay}" |
| 112 | + IsEnabled="{Binding Path=AllowFileRename, Mode=OneWay}" |
| 113 | + Visibility="{Binding Path=ShowFileRename, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}"/> |
| 114 | + </StackPanel> |
| 115 | + |
| 116 | + <TextBlock Text="{Binding ElementName=control, Path=SubmitText}" Foreground="LightGray" Margin="5, 5, 0, 0" FontStyle="Italic" /> |
| 117 | + </StackPanel> |
| 118 | + </Border> |
| 119 | +</UserControl> |
0 commit comments