这里有两个问题 
1、wpf程序中 app.xaml是干什么用的?除了配置些全局的样式以外,能和C#中的app.config一样用吗?
2、我在WPF程序中 添加了app.config的配置文件,想保存些信息,可是修改不了,不知道是什么原因,刚接触WPF,求解
app.config代码如下:<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="index" value="1"/>
  </appSettings>
</configuration>后台Loaded中读取代码://读取配置文件
            try
            {
                imgIndex = int.Parse(ConfigurationManager.AppSettings["index"]);            }
            catch (Exception)
            {                imgIndex = 0;
            }修改保存配置文件://修改配置文件
        private void UpdateConfig(string newKey,string newValue)
        {
            bool isHasNode = false;
            foreach (string key in ConfigurationManager.AppSettings)
            {
                if (key==newKey)
                {
                    isHasNode = true;
                }
            }
            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            if (isHasNode)
            {
                config.AppSettings.Settings.Remove(newKey);
            }
            config.AppSettings.Settings.Add(newKey,newValue);
            config.Save(ConfigurationSaveMode.Modified);
            ConfigurationManager.RefreshSection("appSettings");        }读取没问题 ,修改不了,不知道为什么,求解!~