© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago
Roach

How do I change style of nested items?

Hello there, I'm new to wpf and still learning, I want to change the color of nested two nested rectangles. I got a Window with a frame, that frame get's filled with a page, that has a grid and inside that grid is a ListView with GridViewColumnHeaders, the Headers(of which I got 3 besides only having 2 columns? If someone knows why I would be happy about info about that too) get separated by white rectangles. I tried changing the "Fill" value of the rectangles for "grid" via

<Grid.Resources>
  [more styling]
  <Style TargetType="Rectangle">
    <Setter Property="Fill" Value="{StaticResource brushPalettePrimaryOrange}"/>
  </Style>
</Grid.Resources>
<Grid.Resources>
  [more styling]
  <Style TargetType="Rectangle">
    <Setter Property="Fill" Value="{StaticResource brushPalettePrimaryOrange}"/>
  </Style>
</Grid.Resources>

but that didn't seem to do the trick and <GridViewColumnHeaders.Resources> is not possible it seems, not knowing if it would even help.

I know for changing some stuff in wpf I need to overwrite/make templates. But I'd like to know if there is another way besides that for a case like this?
image.png
image.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Avalonia nested ItemsRepeater datatemplates
C#CC# / help
3y ago
Fastest way to change all items in a nested list
C#CC# / help
4y ago
✅ WPF app style change
C#CC# / help
3y ago