ComboBoxを作成し、設定ファイルを使用して値を入力しようとしています。 最初の試行では動作しますが、設定ファイルの値を変更しようとすると、ComboBoxの項目のリストに反映されません。同じのため コードスニペット -Combobox ItemsSource設定ファイルの古い値を使用
のComboBoxのXAMLコード - 設定ファイルで
<ComboBox Name="vGameMode"
ItemsSource="{Binding Source={x:Static p:Settings1.Default}, Path=Modes}"
SelectedIndex="1">
<!-- <ComboBoxItem Content="Personal"/>
<ComboBoxItem Content="Corporate"/> -->
</ComboBox>
値 -
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="ABC" GeneratedClassName="Settings1">
<Profiles />
<Settings>
<Setting Name="Themes" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)"><?xml version="1.0" encoding="utf-16"?>
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<string>Theme1</string>
<string>Theme2</string>
<string>Theme3</string>
</ArrayOfString></Value>
</Setting>
<Setting Name="DefaultMaxScore" Type="System.Int32" Scope="User">
<Value Profile="(Default)">1000</Value>
</Setting>
<Setting Name="DefaultTimeoutSeconds" Type="System.Int32" Scope="User">
<Value Profile="(Default)">300</Value>
</Setting>
<Setting Name="LeaderboardDays" Type="System.Int32" Scope="User">
<Value Profile="(Default)">7</Value>
</Setting>
<Setting Name="NumberOfTasks" Type="System.Int32" Scope="User">
<Value Profile="(Default)">3</Value>
</Setting>
<Setting Name="CurrentModeIndex" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="DifficultyLevels" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)"><?xml version="1.0" encoding="utf-16"?>
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<string>Medium</string>
<string>Hard</string>
</ArrayOfString></Value>
</Setting>
<Setting Name="GameType" Type="System.Collections.Specialized.StringCollection" Scope="User">
<Value Profile="(Default)"><?xml version="1.0" encoding="utf-16"?>
<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<string>Laser Maze</string>
<string>Laser Buster</string>
</ArrayOfString></Value>
</Setting>
</Settings>
</SettingsFile>
ここで何が間違っている任意のアイデア? 私はそれがどこかにキャッシュされていると推測していますが、どこがわからないのですか。
設定を編集した後でプロジェクトを再コンパイルしましたか? – michip96
別のネットワークからプロジェクトを実行してみてください。モバイルホットスポットまたは別のWi-Fiを使用します。更新された値が得られる可能性が最も高いです。私は同じキャッシュ問題を持っていた –
@ michip96 - はい。私は複数回再コンパイルしました。私はまた、プロジェクトをきれいにし、少なくとも3回再構築しました。 – yashdosi