Discussion: Add a new Style.Resources property to simplify Lightweight Styling.
It would be nice we could add a Resources property to the Style class. It would allow you to define the Resources for this Style. This would simplify Lightweight Styling.

Setting the Resources in a Style.Setter isn't possible because it isn't a Dependency Property. See error message:

There is a workaround which I documented in my XAML Lightweight styling done right blog. It involves a custom Attached Property and a ResourceDictionaryCloner helper class (stolen from @rudyhuyn). @rudyhuyn has published a XamlPlus project with a similar (better) solution for this.
This workaround is a bit awkward and with a Style.Resources property it wouldn't be necessary. I hope you agree. Let's discuss this.
Related Links
Discussion: Add a new Style.Resources property to simplify Lightweight Styling.
It would be nice we could add a Resources property to the Style class. It would allow you to define the Resources for this Style. This would simplify Lightweight Styling.
Setting the Resources in a Style.Setter isn't possible because it isn't a Dependency Property. See error message:
There is a workaround which I documented in my XAML Lightweight styling done right blog. It involves a custom Attached Property and a ResourceDictionaryCloner helper class (stolen from @rudyhuyn). @rudyhuyn has published a XamlPlus project with a similar (better) solution for this.
This workaround is a bit awkward and with a Style.Resources property it wouldn't be necessary. I hope you agree. Let's discuss this.
Related Links