© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•11mo ago
ChildOfDanu

Cant bind styles to elements

Hi!! Actually I am very new to WPF and would appreciate some assistance with a problem I have with this.

So this is the element tree looks like:

Main Window - > contains Navbar -> contains Nav Button <- used by Base Button

so I am trying to pass a Style object from Nav Button to the Base Button where I use the Static Resources followed by the key set for the style

the Style in the base button is bonded to a property

however, the issue is that the styles dont work when I pass in the value to the Base button element in the nav button

however, if I had the button element in the nav button, and passed the style parameter from the nav bar, it works

the code:
https://pastebin.com/AkX1mT3A
Pastebin
WPF #1 - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
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

Setting bind data to DataGridViewComboBoxColumn
C#CC# / help
2y ago
Blazor Dropdown bind to value
C#CC# / help
4y ago
❔ Unable to bind CollectionView to Dictionary
C#CC# / help
3y ago