DynamicResource in Windows Store App apps?

后端 未结 3 546
小蘑菇
小蘑菇 2021-01-15 13:39

WPF\'s support for DynamicResource is great because this allows users to change the look and fell of a running application.

WinRT does not support DynamicResource th

3条回答
  •  长情又很酷
    2021-01-15 14:23

    You don't always need a dynamic resource. Change the value of a "static" resource like this:

    Resources.Remove("foo");
    Resources.Add("foo", "A new hope");
    

    This doesn't always work for declarative stuff. What you can do in these cases is provide a wrapper object; you can't replace the wrapper but you can update its properties. Alas there are cases for which this is not viable.

提交回复
热议问题