How do you override the opacity of a parent control in WPF?
问题 When you set the opacity on a Grid in WPF, all the child elements appear to inherit its Opacity . How can you have a child element not inherit the parent's opacity? For example, the following parent grid has one child grid in the middle with a background set to red, but the background appears pinkish because of the parent's opacity. I'd like the child grid to have a solid color, non-transparent background: <Grid x:Name="LayoutRoot"> <Grid Background="Black" Opacity="0.5"> <Grid.RowDefinitions