protected override void OnInitialized(EventArgs e) //此为窗口已加载 { base.OnInitialized(e); Instance = this; //默认设定为日间模式 ResourceDictionary theme = new ResourceDictionary { Source = new Uri("pack://application:,,,/Resource/Style/Theme/BaseLight.xaml") }; Resources.MergedDictionaries.Add(theme); //判断之前设定的路径是否存在 string location = Properties.Settings.Default.FileLocation; if (location != null && location != string.Empty && !Directory.Exists(location)) { Growl.Warning("所指定的文件夹位置已不存在, 请重新指定."); Properties.Settings.Default.FileLocation = null; } else { RefreshFiles(null, null); } }