Hi Guys,
Me again looking for some more articals or tutorials on Static Resources and binding them through XAML.
Kind regards,
Kieran
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hemant KumarPosted Oct 30, 2011, 12:00 PM
you can get resources object from your code using FindResource method or Resources property of the FrameworkElement. Check if code below would work for you:
though I don't think it's going to work the way you want it or it's a correct solution for your task. What you can do is define a class with colors collection:
in your xaml you can define an ObjectDataProvider of the given object type and bind your control to its Colors property. Smth like this:
another way of how you can do it is binding your controls to a property of the window, smth like this:
xaml:
update0: define resource in the code
hope this helps, regards