private async void Arabic_Clicked() { Activ.IsRunning = true; if (CrossConnectivity.Current.IsConnected) { CrossMultilingual.Current.CurrentCultureInfo = CrossMultilingual.Current.NeutralCultureInfoList.ToList().First(element => element.EnglishName.Contains("Arabic")); AppResources.Culture = CrossMultilingual.Current.CurrentCultureInfo; Settings.LastUserGravity = "Arabic"; GravityClass.Grav(); if (Settings.LastUsedID == 0 || Settings.LastUserStatus == "0") { await Navigation.PushModalAsync(new LoginPage()); } else { await Navigation.PushModalAsync(new MainPage()); } //App.Current.MainPage = new MenuPage(); } else { await DisplayAlert("Message", AppResources.ErrorMessage, "Ok"); } Activ.IsRunning = false; }
private void FlowDirectionPage() { FlowDirection = (Settings.LastUserGravity == "Arabic") ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultures(CultureTypes.NeutralCultures).ToList(). First(element => element.EnglishName.Contains(Settings.LastUserGravity)); AppResources.Culture = Thread.CurrentThread.CurrentUICulture; GravityClass.Grav(); }
protected override void OnElementChanged(VisualElement oldElement, VisualElement newElement) { base.OnElementChanged(oldElement, newElement); var fieldInfo = GetType().BaseType.GetField("_masterLayout", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); var _masterLayout = (ViewGroup)fieldInfo.GetValue(this); var lp = new DrawerLayout.LayoutParams(_masterLayout.LayoutParameters); lp.Gravity = GravityClass.Grav(); _masterLayout.LayoutParameters = lp; }
private void Button_Clicked_1(object sender, EventArgs e) { var language = Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultures(CultureTypes.NeutralCultures).ToList() .First(element => element.EnglishName.Contains("Arabic")); Thread.CurrentThread.CurrentUICulture = language; AppResources.Culture = language; Settings.LastUserGravity = "Arabic"; GravityClass.Grav(); Application.Current.MainPage = new NavigationPage(new MasterPage()); }
private async void Arabic_Clicked(object sender, EventArgs e) { if (CrossConnectivity.Current.IsConnected) { CrossMultilingual.Current.CurrentCultureInfo = CrossMultilingual.Current.NeutralCultureInfoList.ToList().First(element => element.EnglishName.Contains("Arabic")); AppResources.Culture = CrossMultilingual.Current.CurrentCultureInfo; Settings.LastUserGravity = "Arabic"; GravityClass.Grav(); App.Current.MainPage = new HomePage(); } else { await DisplayAlert(AppResources.Error, AppResources.ErrorMessage, AppResources.Ok); } // Activ.IsRunning = false; }
private async void Arabic_Clicked() { if (CrossConnectivity.Current.IsConnected) { CrossMultilingual.Current.CurrentCultureInfo = CrossMultilingual.Current.NeutralCultureInfoList.ToList().First(element => element.EnglishName.Contains("Arabic")); AppResources.Culture = CrossMultilingual.Current.CurrentCultureInfo; Settings.LastUserGravity = "Arabic"; GravityClass.Grav(); App.Current.MainPage = new MainTabbedPage(); } else { await DisplayAlert("Message", AppResources.ErrorMessage, "Ok"); } }
private async void Arabic_Clicked(object sender, EventArgs e) { Arabiclbl.TextColor = Color.Blue; Englishlbl.TextColor = Color.Black; arabicimg.IsVisible = true; Englishimg.IsVisible = false; Activ.IsRunning = true; if (CrossConnectivity.Current.IsConnected) { CrossMultilingual.Current.CurrentCultureInfo = CrossMultilingual.Current.NeutralCultureInfoList.ToList().First(element => element.EnglishName.Contains("Arabic")); AppResources.Culture = CrossMultilingual.Current.CurrentCultureInfo; Settings.LastUserGravity = "Arabic"; GravityClass.Grav(); App.Current.MainPage = new IntroPage(); } else { await DisplayAlert(AppResources.Error, AppResources.ErrorMessage, AppResources.Ok); } Activ.IsRunning = false; }