private void OnPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { switch (e.PropertyName) { case "ADDRESS_COUNTRY_INVALID": VisualUtilities.ShakeView(FieldCountry); break; case "ADDRESS_CITY_INVALID": VisualUtilities.ShakeView(FieldCity); break; case "ADDRESS_POSTCODE_INVALID": VisualUtilities.ShakeView(FieldPostcode); break; case "ADDRESS_STATE_INVALID": VisualUtilities.ShakeView(FieldState); break; case "ADDRESS_STREET_LINE1_INVALID": VisualUtilities.ShakeView(FieldStreet1); break; case "ADDRESS_STREET_LINE2_INVALID": VisualUtilities.ShakeView(FieldStreet2); break; } }
private void OnPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { switch (e.PropertyName) { case "CARD_NUMBER_INVALID": VisualUtilities.ShakeView(FieldCard); break; case "CARD_EXPIRE_DATE_INVALID": VisualUtilities.ShakeView(FieldDate); break; case "CARD_HOLDER_NAME_INVALID": VisualUtilities.ShakeView(FieldCardName); break; case "CARD_CVC_INVALID": VisualUtilities.ShakeView(FieldCVC); break; case "CARD_COUNTRY_INVALID": VisualUtilities.ShakeView(FieldCountry); break; case "CARD_ZIP_INVALID": VisualUtilities.ShakeView(FieldPostcode); break; } if (e.PropertyName.Equals("Navigate")) { View.Navigate(new Uri(ViewModel.PaymentForm.Url)); } }
private void CheckBox_Checked(object sender, RoutedEventArgs e) { if (sender is CheckBox check && check.DataContext is LineViewData line && check.Tag is BaseChartView chartView) { var lines = chartView.GetLines(); if (line.enabled && lines.Except(new[] { line }).Any(x => x.enabled)) { line.enabled = false; check.IsChecked = false; chartView.onCheckChanged(); } else if (!line.enabled) { line.enabled = true; check.IsChecked = true; chartView.onCheckChanged(); } else { VisualUtilities.ShakeView(check); } //var border = //test.onCheckChanged(); } }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if (Date.Date == null) { VisualUtilities.ShakeView(Date); args.Cancel = true; } }
private void OnPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { switch (e.PropertyName) { case "PASSWORD_INVALID": VisualUtilities.ShakeView(PrimaryInput); break; } }
private void AddButtonClick(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(PassText.Password)) { PassText.Focus(FocusState.Keyboard); VisualUtilities.ShakeView(PassText); return; } else if (string.IsNullOrEmpty(RePassText.Password)) { RePassText.Focus(FocusState.Keyboard); VisualUtilities.ShakeView(RePassText); return; } if (PassText.Password.Length == 4) { if (PassText.Password.All(x => x >= '0' && x <= '9') && Helper.Passcode.Check(PassText.Password)) { } else { PassText.Focus(FocusState.Keyboard); VisualUtilities.ShakeView(PassText); Helper.ShowNotify("Enter 4-digits numbers"); return; } } if (RePassText.Password.Length == 4) { if (RePassText.Password.All(x => x >= '0' && x <= '9') && Helper.Passcode.Check(RePassText.Password)) { } else { RePassText.Focus(FocusState.Keyboard); VisualUtilities.ShakeView(RePassText); Helper.ShowNotify("Enter 4-digits numbers"); return; } } { if (PassText.Password == RePassText.Password) { Helper.Passcode.Set(PassText.Password); Hide(); } else { VisualUtilities.ShakeView(RePassText); RePassText.Focus(FocusState.Keyboard); } } }
private void Lock() { if (_passcodeService.RetryIn > 0) { _retryTimer.Start(); } VisualUtilities.ShakeView(Field); Field.Password = string.Empty; }
private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { //if (/*Confirm.Password.Length != 4 || !Confirm.Password.All(x => x >= '0' && x <= '9') ||*/ !_passcodeService.Check(Confirm.Password)) if (await _verify(Confirm.Password)) { VisualUtilities.ShakeView(Confirm); Confirm.Password = string.Empty; args.Cancel = true; } Passcode = Confirm.Password.ToString(); }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if (Date.Date == null || Date.Date < DateTime.Today) { VisualUtilities.ShakeView(Date); args.Cancel = true; } else if (Date.Date == DateTime.Today && Time.Time <= DateTime.Now.TimeOfDay) { VisualUtilities.ShakeView(Time); args.Cancel = true; } }
private void OnPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { switch (e.PropertyName) { case "FILES_INVALID": VisualUtilities.ShakeView(FilesButton); break; case "TRANSLATION_INVALID": VisualUtilities.ShakeView(TranslationButton); break; } }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if (string.IsNullOrEmpty(Text)) { VisualUtilities.ShakeView(TextField); args.Cancel = true; return; } if (IsUrlInvalid(Link)) { VisualUtilities.ShakeView(LinkField); args.Cancel = true; } }
private void PassTextPasswordChanged(object sender, RoutedEventArgs e) { if (PassText.Password.Length == 4) { if (PassText.Password.All(x => x >= '0' && x <= '9') && Helper.Passcode.Check(PassText.Password)) { Unlock(); } else { VisualUtilities.ShakeView(PassText); PassText.Password = string.Empty; } } }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { var service = UnigramContainer.Current.ResolveType <IPasscodeService>(); if (service == null) { return; } if (Confirm.Password.Length != 4 || !Confirm.Password.All(x => x >= '0' && x <= '9') || !service.Check(Confirm.Password)) { VisualUtilities.ShakeView(Confirm); Confirm.Password = string.Empty; args.Cancel = true; } }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if (First.Password.Length != 4 || !First.Password.All(x => x >= '0' && x <= '9')) { VisualUtilities.ShakeView(First); args.Cancel = true; return; } if (!First.Password.Equals(Confirm.Password)) { VisualUtilities.ShakeView(Confirm); args.Cancel = true; return; } Passcode = First.Password.ToString(); }
private void PassTextPasswordChanged(object sender, RoutedEventArgs e) { try { if (PassText.Password.Length == 4) { if (PassText.Password.All(x => x >= '0' && x <= '9') && Helper.Passcode.Check(PassText.Password)) { RePassText.Focus(FocusState.Keyboard); } else { VisualUtilities.ShakeView(PassText); Helper.ShowNotify("Enter 4-digits numbers"); } } } catch { } }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if (IsProxyEnabled) { if (string.IsNullOrEmpty(FieldServer.Text) /* || !IPAddress.TryParse(Server, out IPAddress server)*/) { VisualUtilities.ShakeView(FieldServer); args.Cancel = true; return; } if (string.IsNullOrEmpty(FieldPort.Text) || !int.TryParse(FieldPort.Text, out int port)) { VisualUtilities.ShakeView(FieldPort); args.Cancel = true; return; } } }
private void RePassTextPasswordChanged(object sender, RoutedEventArgs e) { try { if (RePassText.Password.Length == 4) { if (RePassText.Password.All(x => x >= '0' && x <= '9') && Helper.Passcode.Check(PassText.Password)) { AddButtonClick(null, null); } else { VisualUtilities.ShakeView(RePassText); Helper.ShowNotify("Enter 4-digits numbers"); } } } catch { } }
private void CheckBox_Checked(object sender, RoutedEventArgs e) { if (sender is CheckBox check && check.DataContext is LineViewData line) { var lines = chartView.GetLines(); if (line.enabled && lines.Except(new[] { line }).Any(x => x.enabled)) { line.enabled = false; check.IsChecked = false; chartView.OnCheckChanged(); } else if (!line.enabled) { line.enabled = true; check.IsChecked = true; chartView.OnCheckChanged(); } else { VisualUtilities.ShakeView(check); return; } if (data.activeZoom > 0 && zoomedChartView != null) { var zoomedLines = zoomedChartView.GetLines(); var position = lines.IndexOf(line); if (position < zoomedLines.Count) { zoomedLines[position].enabled = line.enabled; zoomedChartView.OnCheckChanged(); } } //var border = //test.onCheckChanged(); } }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if (string.IsNullOrWhiteSpace(Text)) { VisualUtilities.ShakeView(TextField); args.Cancel = true; return; } if (!Link.TrimStart().StartsWith("http")) { Link = "https://" + Link.TrimStart(); } if (IsUrlInvalid(Link)) { VisualUtilities.ShakeView(LinkField); args.Cancel = true; } }
private void RePassTextKeyDown(object sender, KeyRoutedEventArgs e) { if (e.Key == Windows.System.VirtualKey.Enter) { try { if (RePassText.Password.Length == 4) { if (RePassText.Password.All(x => x >= '0' && x <= '9') && Helper.Passcode.Check(PassText.Password)) { AddButtonClick(null, null); } else { VisualUtilities.ShakeView(RePassText); Helper.ShowNotify("Enter 4-digits numbers"); } } } catch { } } }
private void CheckBox_Click(object sender, RoutedEventArgs e) { var check = sender as CheckBox; var item = check.Tag as StorageChartItem; var index = Chart.Items.IndexOf(item); if (index < 0) { return; } if (item.IsVisible && Chart.Items.Except(new[] { item }).Any(x => x.IsVisible)) { item.IsVisible = false; check.IsChecked = false; Chart.Update(index, item.IsVisible); } else if (!item.IsVisible) { item.IsVisible = true; check.IsChecked = true; Chart.Update(index, item.IsVisible); } else { VisualUtilities.ShakeView(check); } var size = Chart.Items.Where(x => x.IsVisible).Sum(x => x.Size); var readable = FileSizeConverter.Convert(size, true).Split(' '); SizeLabel.Text = readable[0]; UnitLabel.Text = readable[1]; }
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if (Label != null) { if (string.IsNullOrEmpty(Label.Text) && !CanBeEmpty) { VisualUtilities.ShakeView(Label); args.Cancel = true; return; } Text = Label.Text; } else if (Password != null) { if (string.IsNullOrEmpty(Password.Password) && !CanBeEmpty) { VisualUtilities.ShakeView(Password); args.Cancel = true; return; } Text = Password.Password; } else if (Number != null) { if (Number.Value < 0 || Number.Value > Maximum) { VisualUtilities.ShakeView(Number); args.Cancel = true; return; } Value = Number.Value; } }