Click here to Skip to main content
15,847,077 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In WPF you can you findresource to find staticresource, like so:
C#
Button b = new Button();
b.Style = (Style)FindResource("CustomButton");


I'm trying to do the same in WP7/Silverlight but FindResource is unavailable. Is there a way to reference the button that I created dynamically to a staticresource? Please help.

Thanks in advance!
Posted
Updated 22-Jan-11 10:22am
v2

1 solution

See http://khason.net/blog/findresource-replacement-and-how-to-change-control-style-more-then-once-in-silverlight-20-application/[^]

BTW you would have hit upon that blog within the first page of a reasonably well-worded google search.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900