在代码中更改应用程序资源

时间:2011-10-06 19:08:22

标签: c# .net silverlight windows-phone-7

我在App.xaml中有一个应用程序资源(见下文),我希望能够从MainPage.xaml.cs进行更改,无论如何都要这样做吗?如果是这样的话?

的App.xaml:

<!--Application Resources-->
<Application.Resources>
    <System:Double x:Key="spinnerAngle">0</System:Double>
</Application.Resources>

1 个答案:

答案 0 :(得分:0)

// retrieve
double spinnerAngle = (double)App.Current.Resources["spinnerAngle"]

// set
App.Current.Resources["spinnerAngle"] = spinnerAngle ;
相关问题