ibogolyubskiy
ibogolyubskiy

Reputation: 2291

How to set ListPickerItem Style in code

I have a ListPicker which is filled dynamically in code. How can I set style of every ListPickerItem which has been added from code? Or how can I set style of future items of ListPicker in XAML?

Thanks.

Upvotes: 0

Views: 896

Answers (1)

Julien
Julien

Reputation: 3529

Try this =>

yourListPickerItem.Style = (Style)FindResource("NameOfYourStyle"); 

EDIT : Silverlight does not implement the FindResource method that exists in the WPF framework API. So, check http://blog.functionalfun.net/2011/01/findresource-implementation-for.html

Upvotes: 1

Related Questions