XAML与C#Metro App [英] XAML with C# Metro App

查看:100
本文介绍了XAML与C#Metro App的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,

我正在尝试使用XAML和C#制作应用程序,但我不知道如何更改主题,我用Google搜索了很多东西并发现了这个东西



//App.xaml.cs

public App()

{

this.InitializeComponent();

App.Current.RequestedTheme = ApplicationTheme.Light; //主题变为光明,但仍然是黑人

this.Suspending + = OnSuspending;

}



请帮我解决这个要求的主题! :(

Hey,
I am trying to make an app with XAML and C#, but i dont know how to change the theme, i googled alot and found this thing

//App.xaml.cs
public App()
{
this.InitializeComponent();
App.Current.RequestedTheme = ApplicationTheme.Light; //theme changed to light,but still blacks
this.Suspending += OnSuspending;
}

Please help me with this requested theme! :(

推荐答案

通常它在App.xaml文件中设置为 Application 属性。如果你想从代码中设置它,尝试在 this.InitializeComponent()之前调用它。
Usually it is set in App.xaml file as the Application attribute. If you want to set it from code, try to call it before this.InitializeComponent().


这篇关于XAML与C#Metro App的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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