//------------------------------------------------------------------------------- #region Constructor //------------------------------------------------------------------------------- // public VirtualizedCirclesList(CatalogData catalogData, CheckList checklist) { _catalogData = catalogData; _checkList = checklist; }
//------------------------------------------------------------------------------- #region navigationHelper_LoadState //------------------------------------------------------------------------------- // /// <summary> /// このページには、移動中に渡されるコンテンツを設定します。前のセッションからページを /// 再作成する場合は、保存状態も指定されます。 /// </summary> /// <param name="sender"> /// イベントのソース (通常、<see cref="NavigationHelper"/>)> /// </param> /// <param name="e">このページが最初に要求されたときに /// <see cref="Frame.Navigate(Type, Object)"/> に渡されたナビゲーション パラメーターと、 /// 前のセッションでこのページによって保存された状態の辞書を提供する /// セッション。ページに初めてアクセスするとき、状態は null になります。</param> private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { //var param = e.NavigationParameter as Tuple<CatalogData, CheckList>; //_catalogData = (param != null) ? param.Item1 : null; //_checkList = (param != null) ? param.Item2 : null; _catalogData = await CatalogData.OpenCatalogData(); var info = await _catalogData.GetComiketInfo(); _checkList = new CheckList(info.comiketNo); if (await CheckList.CheckExistCheckList()) { await _checkList.OpenCheckList(await CheckList.OpenExistCheckList(), _catalogData.GetDayIndex, _catalogData.GetCircleFromId); } //_checkList.PropertyChanged += CheckList_PropertyChanged; if (_catalogData != null) { var names = await _catalogData.GetMapNames(); if (names.Length >= 3) { this.defaultViewModel["MapName1"] = _mapName1 = names[0]; this.defaultViewModel["MapName2"] = _mapName2 = names[1]; this.defaultViewModel["MapName3"] = _mapName3 = names[2]; } var maps = await _catalogData.GetAllMaps(); this.defaultViewModel["MapImage1_E123"] = maps[0]; this.defaultViewModel["MapImage1_E456"] = maps[1]; this.defaultViewModel["MapImage1_W"] = maps[2]; this.defaultViewModel["MapImage2_E123"] = maps[3]; this.defaultViewModel["MapImage2_E456"] = maps[4]; this.defaultViewModel["MapImage2_W"] = maps[5]; this.defaultViewModel["MapImage3_E123"] = maps[6]; this.defaultViewModel["MapImage3_E456"] = maps[7]; this.defaultViewModel["MapImage3_W"] = maps[8]; this.defaultViewModel["MapWidth_E123"] = maps[0].PixelWidth; this.defaultViewModel["MapHeight_E123"] = maps[0].PixelHeight; this.defaultViewModel["MapWidth_E456"] = maps[1].PixelWidth; this.defaultViewModel["MapHeight_E456"] = maps[1].PixelHeight; this.defaultViewModel["MapWidth_W"] = maps[2].PixelWidth; this.defaultViewModel["MapHeight_W"] = maps[2].PixelHeight; var genremaps = await _catalogData.GetAllGenreInfoMaps(); this.defaultViewModel["MapGenreImage1_E123"] = genremaps[0]; this.defaultViewModel["MapGenreImage1_E456"] = genremaps[1]; this.defaultViewModel["MapGenreImage1_W"] = genremaps[2]; this.defaultViewModel["MapGenreImage2_E123"] = genremaps[3]; this.defaultViewModel["MapGenreImage2_E456"] = genremaps[4]; this.defaultViewModel["MapGenreImage2_W"] = genremaps[5]; this.defaultViewModel["MapGenreImage3_E123"] = genremaps[6]; this.defaultViewModel["MapGenreImage3_E456"] = genremaps[7]; this.defaultViewModel["MapGenreImage3_W"] = genremaps[8]; var genres = await _catalogData.GetGenres(); this.defaultViewModel["Genres"] = genres; if (genres.Length > 0) { cmbGenre.SelectedIndex = 0; } } this.defaultViewModel["ColorController"] = _indColorController; if (_checkList == null) { rbSearch_Checklist.IsEnabled = false; rbSearch_SearchString.IsChecked = true; } else { rbSearch_Checklist.IsChecked = true; } if (e.PageState != null) { if (e.PageState.ContainsKey("CheckListFilterText")) { txtCheckListFilter.Text = e.PageState["CheckListFilterText"].ToString(); } if (e.PageState.ContainsKey("SearchStringText")) { txtSearchString.Text = e.PageState["SearchStringText"].ToString(); } if (e.PageState.ContainsKey("GenreText")) { cmbGenre.SelectedItem = e.PageState["GenreText"].ToString(); } if (e.PageState.ContainsKey("SelectedRadioButton")) { RadioButton rb = RADIOBUTTONS[int.Parse(e.PageState["SelectedRadioButton"].ToString())]; rb.IsChecked = true; } //e.PageState["IsSearched"] = false; } }