Hello. Though I think it may be possible to achive the color seen in selected ListBoxItem's background by using SystemControlHighlightListAccentLowBrush background in a container with SystemControlBackgroundChromeMediumLowBrush background, but it's not enough?
e.g.
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Background="{ThemeResource SystemControlBackgroundChromeMediumLowBrush}" Margin="8">
<StackPanel Margin="4">
<StackPanel.Resources>
<Style TargetType="Border">
<Setter Property="Margin" Value="4"/>
<Setter Property="Padding" Value="4"/>
</Style>
</StackPanel.Resources>
<TextBlock Margin="8">Background=SystemControlBackgroundChromeMediumLowBrush (ListBox.Background)</TextBlock>
<Border Background="{ThemeResource SystemControlHighlightListAccentHighBrush}">
<TextBlock>SystemControlHighlightListAccentHighBrush (SelectedPressed)</TextBlock>
</Border>
<Border Background="{ThemeResource SystemControlHighlightListAccentLowBrush}">
<TextBlock>SystemControlHighlightListAccentLowBrush (Selected)</TextBlock>
</Border>
<Border Background="{ThemeResource SystemControlHighlightListAccentMediumBrush}">
<TextBlock>SystemControlHighlightListAccentMediumBrush (SelectedPointerOver)</TextBlock>
</Border>
<Border Background="{ThemeResource SystemControlHighlightListMediumBrush}">
<TextBlock>SystemControlHighlightListMediumBrush (Pressed)</TextBlock>
</Border>
<Border Background="{ThemeResource SystemControlHighlightListLowBrush}">
<TextBlock>SystemControlHighlightListLowBrush (PointerOver)</TextBlock>
</Border>
</StackPanel>
</Border>
<ListBox Grid.Row="1" SelectedIndex="0" Margin="8">
<ListBoxItem>Hello</ListBoxItem>
<ListBoxItem>World</ListBoxItem>
<ListBoxItem IsEnabled="False">Disabled</ListBoxItem>
</ListBox>
</Grid>
Or otherwise, if you'd like to obtain the mixed color in the code behind, interpolate two brushes based on Opacity.
public SolidColorBrush ListBoxSelectedItemBackgroundBrush
{
get
{
// Let's get SystemAccentColor with 0.4 opacity on ListBox's background color.
// <SolidColorBrush x:Key="SystemControlHighlightListAccentLowBrush" Color="{ThemeResource SystemAccentColor}" Opacity="0.4" />
var fg_brush = Resources.ThemeDictionaries["SystemControlHighlightListAccentLowBrush"] as SolidColorBrush;
// <SolidColorBrush x:Key="SystemControlBackgroundChromeMediumLowBrush" Color="{StaticResource SystemChromeMediumLowColor}" />
var bg_brush = Resources.ThemeDictionaries["SystemControlBackgroundChromeMediumLowBrush"] as SolidColorBrush; // #FFF2F2F2 in Light theme
SolidColorBrush mixed_brush = new SolidColorBrush(Color.FromArgb(
(byte)(bg_brush.Color.A * (1.0 - fg_brush.Opacity) + fg_brush.Color.A * fg_brush.Opacity),
(byte)(bg_brush.Color.R * (1.0 - fg_brush.Opacity) + fg_brush.Color.R * fg_brush.Opacity),
(byte)(bg_brush.Color.G * (1.0 - fg_brush.Opacity) + fg_brush.Color.G * fg_brush.Opacity),
(byte)(bg_brush.Color.B * (1.0 - fg_brush.Opacity) + fg_brush.Color.B * fg_brush.Opacity)
));
Debug.WriteLine("#{0:X2}{1:X2}{2:X2}{3:X2}",
mixed_brush.Color.A,
mixed_brush.Color.R,
mixed_brush.Color.G,
mixed_brush.Color.B
); // #FF91C1E7
return mixed_brush;
}
}