using System.Configuration; using System.Windows.Controls; namespace MetroGauges.Controls { /// /// PaletteSelector.xaml 的交互逻辑 /// public partial class PaletteSelector : UserControl { public PaletteSelector() { InitializeComponent(); var x = ConfigurationManager.AppSettings["Intensity"]; if (x == "Dark") { Intensity.IsChecked = true; } if (x == "Light") { Intensity.IsChecked = false; } } } }