如何强制 Windows Phone 8 应用程序以浅色主题运行 [英] How to force windows phone 8 app to be run in light theme

查看:21
本文介绍了如何强制 Windows Phone 8 应用程序以浅色主题运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个 Windows Phone 应用程序,我希望该应用程序以浅色主题运行,而不管用户设置了什么.意味着有什么方法可以为 Windows Phone 8 应用程序设置默认主题.

I have developed a windows phone application, i want that app to be run in light theme, irrespective of what user have set. means is there any way to set a default theme for the windows phone 8 app.

推荐答案

你可以使用 Jeff Wilcox 的 ThemeManager

You can use Jeff Wilcox's ThemeManager

将其添加到您的项目中(有一个 NuGet 包 可用)并从 App() 构造函数.

Add it to your project (there is a NuGet package available) and call it from App() constructor.

public App()
{
    // Global handler for uncaught exceptions.
    UnhandledException += Application_UnhandledException;

    // Standard Silverlight initialization
    InitializeComponent();

    // Phone-specific initialization
    InitializePhoneApplication();

    ThemeManager.ToLightTheme();

    // Other code that might be here already...
}

您可以在他的网站上找到用法示例.

You can find usage example on his website.

这篇关于如何强制 Windows Phone 8 应用程序以浅色主题运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆