あなたは私がウィンドウの位置や大きさを思い出すために使用するいくつかのコードです。ここProperties.Settings.Default.Save();
を呼び出すなら、彼らが永久的に保存されます。
private void save_position(object sender, CancelEventArgs e)
{
Properties.Settings.Default.Save();
}
:これにより
<Window x:Class="my_namespace.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:my_namespace"
Closing="save_position"
Height="{Binding Source={x:Static local:Properties.Settings.Default}, Path=height, Mode=TwoWay}"
Width="{Binding Source={x:Static local:Properties.Settings.Default}, Path=width, Mode=TwoWay}"
Top="{Binding Source={x:Static local:Properties.Settings.Default}, Path=top, Mode=TwoWay}"
Left="{Binding Source={x:Static local:Properties.Settings.Default}, Path=left, Mode=TwoWay}">
が背後にあるコードで
システムをシャットダウンしてもこれらの設定は保存されますか?彼らがシステム再起動のためにそれらを保存する必要があるので、彼らが一時的ではないことを確認したかった。 – PleaseHelp
あなたがそれらを保存している場合、それらは最も永続的です。作成された設定ファイルで結果を確認できるはずです。アプリケーションスコープの設定は、.exeで動作するファイルに保存されます。実行時に変更して保存するので、これらはユーザースコープでなければなりません。ユーザースコープの設定は、使用しているWindowsのバージョンによって異なる場所に配置されますが、C:\ Documents and Settings \ username \ Local Settings \ Application Dataのようなものです。 Visual Studioを再起動しても、値がどのように保持されているかがわかります。 – jmccarthy