[PowerRename] Add row highlighting (#14746)

* Add Highlight property to ExplorerItem

* Change property type

* Initialize property

* Update MainWindow.xaml

* Update MainWindow.xaml

* Update MainWindow.xaml

* Updated brush

Co-authored-by: Stefan Markovic <stefan@janeasystems.com>
This commit is contained in:
Niels Laute
2021-12-02 13:02:12 +01:00
committed by GitHub
parent 0e61f41e31
commit a018e0493b
4 changed files with 68 additions and 23 deletions

View File

@@ -77,7 +77,7 @@
<ControlTemplate TargetType="ListViewItem">
<StackPanel Orientation="Vertical">
<ContentPresenter />
<Rectangle Height="1" Margin="0,4,0,0" Opacity="0.8" Grid.ColumnSpan="5" Fill="{ThemeResource CardStrokeColorDefaultBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" />
<Rectangle Height="1" Margin="0,0,0,0" Opacity="0.8" Grid.ColumnSpan="5" Fill="{ThemeResource CardStrokeColorDefaultBrush}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" />
</StackPanel>
</ControlTemplate>
@@ -87,33 +87,55 @@
</ListView.ItemContainerStyle>
<ListView.ItemTemplate>
<DataTemplate x:Name="ExplorerItemTemplate" x:DataType="local:ExplorerItem">
<Grid Height="20" Margin="10,4,0,0">
<Grid Height="28" Padding="0,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Column="0">
<StackPanel MinWidth="{x:Bind Indentation}"/>
<CheckBox TabIndex="0"
MinWidth="0"
XYFocusKeyboardNavigation="Enabled"
Checked="Checked_ids"
IsTabStop="True"
Unchecked="Checked_ids"
Content=""
Name="{x:Bind IdStr}"
AutomationProperties.Name="{x:Bind Original}"
AutomationProperties.HelpText="{x:Bind Renamed}"
IsChecked="{x:Bind Checked, Mode=TwoWay}" />
<Image Width="16" Margin="4,0,0,0" Source="{x:Bind ImagePath}" HorizontalAlignment="Left" />
<TextBlock Margin="6,0,0,0"
Text="{x:Bind Original, Mode=OneWay}"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
VerticalAlignment="Center"
FontSize="12" />
</StackPanel>
<TextBlock Text="{x:Bind Renamed, Mode=OneWay}" Grid.Column="1" FontWeight="Bold" VerticalAlignment="Center" FontSize="12" />
<Border HorizontalAlignment="Stretch" Grid.ColumnSpan="2" BorderThickness="0,0,0,1" Margin="0,0,0,-1" BorderBrush="{ThemeResource SystemAccentColor}" VerticalAlignment="Stretch" Background="{ThemeResource AccentTextFillColorPrimaryBrush}" Opacity="0.1" Visibility="{x:Bind Highlight, Mode=OneWay}" />
<Grid Grid.Column="0" HorizontalAlignment="Left" Margin="10,4,0,4">
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="{x:Bind Indentation}"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<CheckBox TabIndex="0"
MinWidth="0"
Width="28"
Height="28"
Grid.Column="1"
XYFocusKeyboardNavigation="Enabled"
Checked="Checked_ids"
IsTabStop="True"
Unchecked="Checked_ids"
Content=""
Name="{x:Bind IdStr}"
AutomationProperties.Name="{x:Bind Original}"
AutomationProperties.HelpText="{x:Bind Renamed}"
IsChecked="{x:Bind Checked, Mode=TwoWay}" />
<Image Width="16"
Grid.Column="2"
Margin="4,0,0,0"
Source="{x:Bind ImagePath}"
HorizontalAlignment="Left" />
<TextBlock Margin="6,0,0,0"
Grid.Column="3"
Text="{x:Bind Original, Mode=OneWay}"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
VerticalAlignment="Center"
FontSize="12" />
</Grid>
<TextBlock Text="{x:Bind Renamed, Mode=OneWay}"
Grid.Column="1"
FontWeight="Bold"
Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
VerticalAlignment="Center"
FontSize="12" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>