Search code examples
xamlwindows-store-appsstyles

Dynamically changing style without using Dynamic Resource?


I want to define 2 styles, 1 for high end and 1 for low end. On initial app run, system determines which one to use.

I'm thinking how to implement this. I read about DynamicResource but also know about performance considerations using it (since I'm also targeting low end devices). This is a main style used by buttons through the app.

Is it possible to use Binding of the style? Something like Bind a static variable?

What would be the best approach for this?

Thank you!


Solution

  • You might want to look into TemplateSelector, it might help:

    Here's an example...

    http://www.jerriepelser.com/blog/3-ways-dynamic-data-templates