We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This issue results from #3899
It's not possible to override ListBoxItem triggered brushes via own style like
<Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource MahApps.Styles.ListBoxItem}"> <Setter Property="Controls:ItemHelper.HoverBackgroundBrush" Value="{DynamicResource MahApps.Brushes.Gray}" /> <Setter Property="Controls:ItemHelper.HoverSelectedBackgroundBrush" Value="{DynamicResource MahApps.Brushes.Gray1}" /> <Style.Triggers> <EventTrigger RoutedEvent="PreviewMouseRightButtonDown"> <BeginStoryboard x:Name="BeginStoryboard_IsPressed"> <Storyboard> <ObjectAnimationUsingKeyFrames Duration="0:0:0" Storyboard.TargetProperty="Background"> <!-- Note: It's not possible to use DynamicResource inside a Storyboard. So use StaticResource or a static Brush instead. --> <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{x:Static Brushes.Red}" /> </ObjectAnimationUsingKeyFrames> </Storyboard> </BeginStoryboard> </EventTrigger> <EventTrigger RoutedEvent="PreviewMouseRightButtonUp"> <RemoveStoryboard BeginStoryboardName="BeginStoryboard_IsPressed" /> </EventTrigger> </Style.Triggers> </Style>
The Background of the ListBoxItem should be changed if the user clicks the right mouse button.
Nothing happens.
MahApps.Metro version: v2.2.0 Target Framework: .Net Core 3.1 (v4.5.2, v4.7.2)
The text was updated successfully, but these errors were encountered:
(GH-3900) Enable overriding ItemsControl trigger brushes
f4b2b46
@punker76, these changes break if you're using an alternation index background on the container:
<Style.Triggers> <Trigger Property="ItemsControl.AlternationIndex" Value="0"> <Setter Property="Background" Value="{DynamicResource MahApps.Brushes.Gray10}" /> </Trigger> </Style.Triggers>
It's now no longer possible to set a normal background for these while retaining the hover backgrounds etc.
Sorry, something went wrong.
(GH-3900) Allow set background and foreground for mouse right and lef…
4946b9b
…t button down
(GH-3900) Fix not showing alternation background when ItemsControl is…
1ba6a48
… disabled
punker76
Successfully merging a pull request may close this issue.
Describe the bug
This issue results from #3899
It's not possible to override ListBoxItem triggered brushes via own style like
Expected behavior
The Background of the ListBoxItem should be changed if the user clicks the right mouse button.
Actual behavior
Nothing happens.
Environment
Screenshots
The text was updated successfully, but these errors were encountered: