private void KeepOrientationClick(NavigationLink link) { if (DisplayInformation.AutoRotationPreferences == DisplayOrientations.None) { link.Label = Quran.Core.Properties.Resources.auto_orientation; DisplayInformation.AutoRotationPreferences = DisplayInformation.GetForCurrentView().CurrentOrientation; } else { link.Label = Quran.Core.Properties.Resources.keep_orientation; DisplayInformation.AutoRotationPreferences = DisplayOrientations.None; } }
// Build a localized Menu private void BuildLocalizedMenu() { NavigationLinks.Add(new NavigationLink { Label = Quran.Core.Properties.Resources.home, Symbol = Symbol.Home, Action = () => { Frame.Navigate(typeof(MainView)); } }); NavigationLinks.Add(new NavigationLink { Label = Quran.Core.Properties.Resources.translation, Symbol = Symbol.Globe, Action = TranslationClick }); _bookmarkNavigationLink = new NavigationLink { Action = () => { ViewModel.TogglePageBookmark(); } }; SetBookmarkNavigationLink(); NavigationLinks.Add(_bookmarkNavigationLink); NavigationLinks.Add(new NavigationLink { Label = Quran.Core.Properties.Resources.recite, Symbol = Symbol.Volume, Action = () => { AudioPlay(this, null); } }); var keepOrientationLink = new NavigationLink { Label = Quran.Core.Properties.Resources.keep_orientation, Symbol = Symbol.Orientation, }; keepOrientationLink.Action = () => { KeepOrientationClick(keepOrientationLink); }; NavigationLinks.Add(keepOrientationLink); }