private void ButtonDecision_Click(object sender, RoutedEventArgs e)
        {
            NameValueInfo info = ListBoxItem.SelectedItem as NameValueInfo;

            if (info == null)
            {
                return;
            }
            ID = info.Value;
            Close();
        }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     CreateItemList("");
     foreach (var item in ListBoxItem.Items)
     {
         NameValueInfo info = item as NameValueInfo;
         if (info.Value == ID)
         {
             ListBoxItem.SelectedItem = item;
             ListBoxItem.ScrollIntoView(item);
             break;
         }
     }
 }
        public DataContext()
        {
            SaveData save = SaveData.Instance();

            foreach (var address in save.FindAddress("CharacterID_", 0))
            {
                var chara = new Charactor(address);
                if (chara.ID < 0 || chara.ID > 8)
                {
                    continue;
                }
                Charactors.Add(chara);
            }

            foreach (var address in save.FindAddress("ItemID_", 0))
            {
                Items.Add(new Item(address));
            }

            var gvas = new GVAS(null);

            gvas.AppendValue(save.FindAddress("MainMemberID_", 0)[0]);
            for (uint i = 0; i < 4; i++)
            {
                MainParty.Add(new Member(gvas.Key("MainMemberID_" + i.ToString()).Address));
            }

            gvas = new GVAS(null);
            gvas.AppendValue(save.FindAddress("SubMissionOrder", 0)[0]);
            for (uint i = 0; i < 200; i++)
            {
                MissionIDs.Add(new MissionID(gvas.Key("SubMissionOrder_" + i.ToString())));
            }

            var missionStates = save.FindAddress("MissionState_", 0);
            var clearIndex    = save.FindAddress("ClearIndex_", 0);

            if (missionStates.Count == clearIndex.Count)
            {
                for (int i = 0; i < missionStates.Count; i++)
                {
                    var stateGvas = new GVAS(null);
                    stateGvas.AppendValue(missionStates[i]);
                    var clearGvas = new GVAS(null);
                    clearGvas.AppendValue(clearIndex[i]);

                    var mission = new CountryMission()
                    {
                        Country = Info.Instance().Countris[i].Name
                    };
                    for (int j = 0; j < 100; j++)
                    {
                        mission.Missions.Add(new Mission(stateGvas.Key("MissionState_" + j.ToString()), clearGvas.Key("ClearIndex_" + j.ToString())));
                    }
                    Countris.Add(mission);
                }
            }

            gvas = new GVAS(null);
            gvas.AppendValue(save.FindAddress("VisitedMap", 0)[0]);
            uint id = 0;

            for (uint i = 0; i < 10; i++)
            {
                GVASData data = gvas.Key("VisitedMap_" + i.ToString());
                for (uint size = 0; size < data.Size; size++)
                {
                    for (uint bit = 0; bit < 8; bit++)
                    {
                        var           place = new Place(data.Address + size, bit);
                        NameValueInfo info  = Info.Instance().Search(Info.Instance().Places, id);
                        if (info != null)
                        {
                            place.Name = info.Name;
                        }
                        Places.Add(place);
                        id++;
                    }
                }
            }

            gvas = new GVAS(null);
            uint tame = save.FindAddress("TameMonsterData", 0)[0];

            for (uint i = 0; i < 10; i++)
            {
                uint enemyAddress = save.FindAddress("EnemyID_", tame)[0];
                TameMonsters.Add(new TameMonster(enemyAddress));
                tame = enemyAddress + 1;
            }

            uint weaks = save.FindAddress("EnemyInfoData", 0)[0];

            System.Console.WriteLine(save.FindAddress("IsAnalyse_", 0).Count);
            foreach (uint i in save.FindAddress("IsAnalyse_", 0))
            {
                EnemyWeaknesses.Add(new EnemyWeakness(i));
            }

            gvas = new GVAS(null);
            gvas.AppendValue(save.FindAddress("Money_", 0)[0]);
            mMoneyAddress = gvas.Key("Money").Address;
            gvas          = new GVAS(null);
            gvas.AppendValue(save.FindAddress("FirstSelectCharacterID", 0)[0]);
            mHeroAddress = gvas.Key("FirstSelectCharacterID").Address;
        }