/// <summary> /// 既存のfragmentのviewModelRequestのパラメータを変更し、再利用します /// </summary> /// <param name="fragment">Fragment.</param> /// <param name="date">Date.</param> private void UpdateViewModelRequestParam(RecordDetailView fragment, int recordId) { if (fragment.ViewModel != null) { ((RecordDetailViewModel)fragment.ViewModel).RecordId = recordId; } }
/// <summary> /// 再利用リストを初期化する /// </summary> private void SetUpAvailableViews() { if (_convertViews == null || _convertViews.Count == 0) { _convertViews = new List <RecordDetailView> (); for (var i = 0; i < 4; i++) { var fragment = new RecordDetailView(); RecordDetailViewModel viewModel; if (_viewModelList.Count < i + 1) { viewModel = Mvx.IocConstruct <RecordDetailViewModel> (); } else { viewModel = _viewModelList [i]; } fragment.ViewModel = viewModel; _convertViews.Add(fragment); } } }
/// <summary> /// 利用できるDailyDetailScheduleViewを取得する. /// </summary> /// <returns>The available view.</returns> private RecordDetailView GetAvailableView() { if (null == _convertViews || 0 == _convertViews.Count) { var fragment = new RecordDetailView(); var viewModel = Mvx.IocConstruct <RecordDetailViewModel> (); fragment.ViewModel = viewModel; _convertViews.Add(fragment); } var view = _convertViews.FirstOrDefault(); _convertViews.RemoveAt(0); return(view); }