private async void GenerateCell_Tapped(object sender, EventArgs e) { var page = new ToolsPasswordGeneratorPage((password) => { PasswordCell.Entry.Text = password; _userDialogs.Toast(AppResources.PasswordGenerated); }); await Navigation.PushForDeviceAsync(page); }
private async void GenerateCell_Tapped(object sender, EventArgs e) { var page = new ToolsPasswordGeneratorPage((password) => { LoginPasswordCell.Entry.Text = password; _deviceActionService.Toast(AppResources.PasswordGenerated); }, _fromAutofill); await Navigation.PushForDeviceAsync(page); }
public SliderViewCell( ToolsPasswordGeneratorPage page, IPasswordGenerationService passwordGenerationService, ISettings settings) { _page = page; _passwordGenerationService = passwordGenerationService; _settings = settings; var label = new Label { FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)), Text = AppResources.Length, HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.CenterAndExpand }; LengthSlider = new Slider(5, 64, _settings.GetValueOrDefault(Constants.PasswordGeneratorLength, 10)) { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand, MaximumTrackColor = Color.LightGray, MinimumTrackColor = Color.LightGray, }; Value = new Label { FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)), HorizontalOptions = LayoutOptions.End, VerticalOptions = LayoutOptions.CenterAndExpand, Style = (Style)Application.Current.Resources["text-muted"], FontFamily = Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", Windows: "Courier"), }; Value.SetBinding(Label.TextProperty, nameof(PasswordGeneratorPageModel.Length)); var stackLayout = new StackLayout { Orientation = StackOrientation.Horizontal, Spacing = 15, Children = { label, LengthSlider, Value }, Padding = Helpers.OnPlatform( iOS: new Thickness(15, 8), Android: new Thickness(16, 10), Windows: new Thickness(15, 8)) }; stackLayout.AdjustPaddingForDevice(); if (Device.RuntimePlatform == Device.Android) { label.TextColor = Color.Black; } View = stackLayout; }
public SliderViewCell( ToolsPasswordGeneratorPage page, IPasswordGenerationService passwordGenerationService, ISettings settings) { _page = page; _passwordGenerationService = passwordGenerationService; _settings = settings; var label = new Label { FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)), Text = "Length", HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.CenterAndExpand }; LengthSlider = new Slider(5, 64, _settings.GetValueOrDefault(Constants.PasswordGeneratorLength, 10)) { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand }; Value = new Label { FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)), HorizontalOptions = LayoutOptions.End, VerticalOptions = LayoutOptions.CenterAndExpand, Style = (Style)Application.Current.Resources["text-muted"] }; Value.SetBinding <PasswordGeneratorPageModel>(Label.TextProperty, m => m.Length); LengthSlider.ValueChanged += Slider_ValueChanged; var stackLayout = new StackLayout { Orientation = StackOrientation.Horizontal, Spacing = 15, Children = { label, LengthSlider, Value }, Padding = Device.OnPlatform( iOS: new Thickness(15, 8), Android: new Thickness(16, 10), WinPhone: new Thickness(15, 8)) }; stackLayout.AdjustPaddingForDevice(); if (Device.OS == TargetPlatform.Android) { label.TextColor = Color.Black; } View = stackLayout; }
private async void GenerateCell_Tapped(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(PasswordCell.Entry.Text) && !await _userDialogs.ConfirmAsync(AppResources.PasswordOverrideAlert, null, AppResources.Yes, AppResources.No)) { return; } var page = new ToolsPasswordGeneratorPage((password) => { PasswordCell.Entry.Text = password; _userDialogs.Toast(AppResources.PasswordGenerated); }); await Navigation.PushForDeviceAsync(page); }
private async void GenerateCell_Tapped(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(LoginPasswordCell.Entry.Text) && !(await DisplayAlert(null, AppResources.PasswordOverrideAlert, AppResources.Yes, AppResources.No))) { return; } var page = new ToolsPasswordGeneratorPage((password) => { LoginPasswordCell.Entry.Text = password; _deviceActionService.Toast(AppResources.PasswordGenerated); }); await Navigation.PushForDeviceAsync(page); }
private async void GenerateCell_Tapped(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(PasswordCell.Entry.Text) && !await _userDialogs.ConfirmAsync("Are you sure you want to overwrite the current password?", null, AppResources.Yes, AppResources.No)) { return; } var page = new ToolsPasswordGeneratorPage((password) => { PasswordCell.Entry.Text = password; _userDialogs.Toast("Password generated."); }); await Navigation.PushForDeviceAsync(page); }