private void ViewModelOnNavigationRequest(SettingsPageIndex page) { Fragment fragment = null; switch (page) { case SettingsPageIndex.General: fragment = new SettingsGeneralFragment(); break; case SettingsPageIndex.Caching: break; case SettingsPageIndex.Calendar: fragment = new SettingsCalendarFragment(); break; case SettingsPageIndex.Articles: break; case SettingsPageIndex.News: break; case SettingsPageIndex.About: fragment = new SettingsAboutFragment(); break; case SettingsPageIndex.LogIn: break; case SettingsPageIndex.Misc: fragment = new SettingsMiscFragment(); break; case SettingsPageIndex.Homepage: fragment = new SettingsHomepageFragment(); break; case SettingsPageIndex.Notifications: fragment = new SettingsNotificationsFragment(); break; case SettingsPageIndex.Ads: fragment = new SettingsAdsFragment(); break; case SettingsPageIndex.Feeds: fragment = new SettingsFeedsFragment(); break; case SettingsPageIndex.Info: fragment = new SettingsInfoFragment(); break; default: throw new ArgumentOutOfRangeException(nameof(page), page, null); } try { var trans = ChildFragmentManager.BeginTransaction(); trans.DisallowAddToBackStack(); trans.SetCustomAnimations(Resource.Animator.animation_slide_btm, Resource.Animator.animation_sink_in, Resource.Animator.animation_slide_btm, Resource.Animator.animation_sink_in); trans.Replace(Resource.Id.SearchPageContentFrame, fragment); trans.CommitAllowingStateLoss(); } catch (Exception e) { } _navigated = true; }
private void ViewModelOnNavigationRequest(SettingsPageIndex page) { Fragment fragment = null; switch (page) { case SettingsPageIndex.General: fragment = new SettingsGeneralFragment(); break; case SettingsPageIndex.Caching: break; case SettingsPageIndex.Calendar: fragment = new SettingsCalendarFragment(); break; case SettingsPageIndex.Articles: break; case SettingsPageIndex.News: break; case SettingsPageIndex.About: break; case SettingsPageIndex.LogIn: break; case SettingsPageIndex.Misc: break; case SettingsPageIndex.Homepage: fragment = new SettingsHomepageFragment(); break; case SettingsPageIndex.Notifications: fragment = new SettingsNotificationsFragment(); break; case SettingsPageIndex.Ads: fragment = new SettingsAdsFragment(); break; case SettingsPageIndex.Feeds: fragment = new SettingsFeedsFragment(); break; default: throw new ArgumentOutOfRangeException(nameof(page), page, null); } if (fragment == null) { Toast.MakeText(Activity, "Not implemented yet, traveller!", ToastLength.Short); return; } var trans = FragmentManager.BeginTransaction(); trans.SetCustomAnimations(Resource.Animator.animation_slide_btm, Resource.Animator.animation_fade_out, Resource.Animator.animation_slide_btm, Resource.Animator.animation_fade_out); trans.Replace(Resource.Id.SearchPageContentFrame, fragment); trans.Commit(); }