C# 如何使Windows Phone 8.1计时器从系统区域格式继承?

C# 如何使Windows Phone 8.1计时器从系统区域格式继承?,c#,wpf,windows-phone-8.1,windows-phone,globalization,C#,Wpf,Windows Phone 8.1,Windows Phone,Globalization,当我向Windows Phone 8.1应用程序添加计时器控件时,它使用12小时格式,而不是在操作系统级别配置的区域格式(设置>区域>区域格式) 我知道我可以通过设置ClockIdentifier属性手动强制设置格式,但我正在寻找一个更优雅的/全局解决方案,该解决方案使用系统设置并同时配置所有控件 如果必须手动执行,如何检索系统时间格式?一个可尝试的选项是 private void SetCaptions() { System.ComponentModel.ComponentResour

当我向Windows Phone 8.1应用程序添加计时器控件时,它使用12小时格式,而不是在操作系统级别配置的区域格式(设置>区域>区域格式)

我知道我可以通过设置ClockIdentifier属性手动强制设置格式,但我正在寻找一个更优雅的/全局解决方案,该解决方案使用系统设置并同时配置所有控件

如果必须手动执行,如何检索系统时间格式?

一个可尝试的选项是

private void SetCaptions()
{
    System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
    this.SuspendLayout();
    for (int i = 0; i != Controls.Count; i++)
    {
        resources.ApplyResources(Controls[i], Controls[i].Name, Program.Culture);
    }
    resources.ApplyResources(this, "$this", Program.Culture);
    this.ResumeLayout(false);
}
(见:)

还有
System.Globalization.CultureInfo.CurrentCulture
System.Globalization.CultureInfo.CurrentUICulture
可以通过编程进行设置。

一个可以尝试的选项是

private void SetCaptions()
{
    System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
    this.SuspendLayout();
    for (int i = 0; i != Controls.Count; i++)
    {
        resources.ApplyResources(Controls[i], Controls[i].Name, Program.Culture);
    }
    resources.ApplyResources(this, "$this", Program.Culture);
    this.ResumeLayout(false);
}
(见:)

还有
System.Globalization.CultureInfo.CurrentCulture
System.Globalization.CultureInfo.CurrentUICulture
可以通过编程进行设置