"Persistent" 切换到 WPF/XAML

"Persistent" Switches in WPF/XAML

我有一个程序,其行为应该根据它是否 运行 超过一次而改变。是否可以有一个开关在每个 运行 之间保留其值,告诉程序该做什么?

例如(显然是伪代码):

if (first_run){
    make splash screen say "Welcome, Newcomer!";
    give a tour of program on boot;
}
else {
    make splash screen say "Hello again!";
    do not give tour;
}

我看到 this, but apparently Windows.Storage's minimum supported client is Windows 8, and I want my application to be available for Windows 7 users. In addition, using the code suggested 被接受的回答者抛出 Type Windows.Storage.ApplicationDataContainer is not defined 错误。

我是 XAML 和 WPF 的新手,如果这很简单,请原谅我;我用 Google 搜索并没有找到相关结果(我什至不知道 if/how 可以在 WPF 中嵌入 C#,因为我在 VS2013 中没有看到它的选项)。

谢谢!

关于在项目属性中找到的普通旧设置有什么问题。在那里定义一个 int 键并在每个 运行 上递增它,例如在初始化事件上。 详情见文档:http://blogs.msdn.com/b/patrickdanino/archive/2008/07/23/user-settings-in-wpf.aspx