Add alternating row colors and hover effects to DataGrid in CompactDiscInfo, PcmciaInfo, and ScsiInfo

This commit is contained in:
2025-12-15 16:15:22 +00:00
parent 4a0bd8b856
commit 9509cb9054
3 changed files with 84 additions and 0 deletions

View File

@@ -46,6 +46,34 @@
<Design.DataContext>
<tabs:CompactDiscInfoViewModel />
</Design.DataContext>
<UserControl.Styles>
<Style Selector="DataGridRow:nth-child(2n)">
<Setter Property="Background">
<SolidColorBrush Color="#0CFFFFFF" />
</Setter>
</Style>
<Style Selector="DataGridRow:nth-child(2n) DataGridCell">
<Setter Property="Background">
<SolidColorBrush Color="#0CFFFFFF" />
</Setter>
</Style>
<Style Selector="DataGridRow:nth-child(2n):pointerover">
<Setter Property="Background"
Value="{DynamicResource SystemControlHighlightListLowBrush}" />
</Style>
<Style Selector="DataGridRow:nth-child(2n):pointerover DataGridCell">
<Setter Property="Background"
Value="{DynamicResource SystemControlHighlightListLowBrush}" />
</Style>
<Style Selector="DataGridRow:nth-child(2n):selected">
<Setter Property="Background"
Value="{DynamicResource SystemControlHighlightAccentBrush}" />
</Style>
<Style Selector="DataGridRow:nth-child(2n):selected DataGridCell">
<Setter Property="Background"
Value="{DynamicResource SystemControlHighlightAccentBrush}" />
</Style>
</UserControl.Styles>
<TabControl>
<TabItem IsVisible="False">
<TabItem.Header>

View File

@@ -46,6 +46,34 @@
<Design.DataContext>
<tabs:PcmciaInfoViewModel />
</Design.DataContext>
<UserControl.Styles>
<Style Selector="DataGridRow:nth-child(2n)">
<Setter Property="Background">
<SolidColorBrush Color="#0CFFFFFF" />
</Setter>
</Style>
<Style Selector="DataGridRow:nth-child(2n) DataGridCell">
<Setter Property="Background">
<SolidColorBrush Color="#0CFFFFFF" />
</Setter>
</Style>
<Style Selector="DataGridRow:nth-child(2n):pointerover">
<Setter Property="Background"
Value="{DynamicResource SystemControlHighlightListLowBrush}" />
</Style>
<Style Selector="DataGridRow:nth-child(2n):pointerover DataGridCell">
<Setter Property="Background"
Value="{DynamicResource SystemControlHighlightListLowBrush}" />
</Style>
<Style Selector="DataGridRow:nth-child(2n):selected">
<Setter Property="Background"
Value="{DynamicResource SystemControlHighlightAccentBrush}" />
</Style>
<Style Selector="DataGridRow:nth-child(2n):selected DataGridCell">
<Setter Property="Background"
Value="{DynamicResource SystemControlHighlightAccentBrush}" />
</Style>
</UserControl.Styles>
<Grid RowDefinitions="*, Auto"
RowSpacing="8"
Margin="8">

View File

@@ -46,6 +46,34 @@
<Design.DataContext>
<tabs:ScsiInfoViewModel />
</Design.DataContext>
<UserControl.Styles>
<Style Selector="DataGridRow:nth-child(2n)">
<Setter Property="Background">
<SolidColorBrush Color="#0CFFFFFF" />
</Setter>
</Style>
<Style Selector="DataGridRow:nth-child(2n) DataGridCell">
<Setter Property="Background">
<SolidColorBrush Color="#0CFFFFFF" />
</Setter>
</Style>
<Style Selector="DataGridRow:nth-child(2n):pointerover">
<Setter Property="Background"
Value="{DynamicResource SystemControlHighlightListLowBrush}" />
</Style>
<Style Selector="DataGridRow:nth-child(2n):pointerover DataGridCell">
<Setter Property="Background"
Value="{DynamicResource SystemControlHighlightListLowBrush}" />
</Style>
<Style Selector="DataGridRow:nth-child(2n):selected">
<Setter Property="Background"
Value="{DynamicResource SystemControlHighlightAccentBrush}" />
</Style>
<Style Selector="DataGridRow:nth-child(2n):selected DataGridCell">
<Setter Property="Background"
Value="{DynamicResource SystemControlHighlightAccentBrush}" />
</Style>
</UserControl.Styles>
<TabControl>
<TabItem IsVisible="{Binding !!InquiryData, Mode=OneWay}">
<TabItem.Header>