我想让WPF应用程序的用户有机会更改应用程序的背景颜色。为此,他有一个组合框与一些值:WPF BackgroundColor
cbSetBackground.Items.Add("green");
cbSetBackground.Items.Add("red");
cbSetBackground.Items.Add("blue");
cbSetBackground.Items.Add("yellow");
现在,与点击事件,我必须将backgroundcolor到选定的颜色。我试过这样的
this.Background = Brushes. + cbSetBackground.SelectedItem.ToString();
当然,这不工作。 我该如何管理?
非常感谢你。你知道吗,我可以如何设置这个背景颜色到我的整个应用程序?我必须在构造函数中提交它吗? – user896692 2011-12-30 15:34:30