C# wpf --- This is a "continuation" of c-sharpcorner.com/forums/how-do-change-the-background-color-on-one-listbox-item-continued-sharp4.
The
C#
The attachable property 'Resources' was not found in type 'UserControl'.There does not seem to be a solution. Thanks to the responses by Abhishek Yadav, Naimish Makwana, Tuhin Paul, and Rohini Parade.

Tuhin PaulRank #7 · 71.9K reputationPosted Mar 17, 2024, 2:19 PM EDT
1. There's a common attached property called
FrameworkElement.Resourcesthat you can use on anyFrameworkElement(whichUserControlinherits from). This property allows you to define a localResourceDictionaryfor the UserControl.2. You can define resources in a separate
ResourceDictionaryfile and include it in your application or specific windows.