How to force windows phone 8 app to be run in light theme

前端 未结 4 1972
梦毁少年i
梦毁少年i 2020-12-17 20:20

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

4条回答
  •  无人及你
    2020-12-17 21:05

    You can use Jeff Wilcox's ThemeManager

    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.

提交回复
热议问题