コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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));
            }
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
 private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
 {
     if (Date.Date == null)
     {
         VisualUtilities.ShakeView(Date);
         args.Cancel = true;
     }
 }
コード例 #5
0
 private void OnPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     switch (e.PropertyName)
     {
     case "PASSWORD_INVALID":
         VisualUtilities.ShakeView(PrimaryInput);
         break;
     }
 }
コード例 #6
0
        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);
                }
            }
        }
コード例 #7
0
        private void Lock()
        {
            if (_passcodeService.RetryIn > 0)
            {
                _retryTimer.Start();
            }

            VisualUtilities.ShakeView(Field);
            Field.Password = string.Empty;
        }
コード例 #8
0
        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();
        }
コード例 #9
0
 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;
     }
 }
コード例 #10
0
        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;
            }
        }
コード例 #11
0
        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;
            }
        }
コード例 #12
0
ファイル: PasscodeView.xaml.cs プロジェクト: xuan2261/Minista
 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;
         }
     }
 }
コード例 #13
0
        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;
            }
        }
コード例 #14
0
        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();
        }
コード例 #15
0
 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 { }
 }
コード例 #16
0
ファイル: ProxyView.xaml.cs プロジェクト: nazzi88ua/Unigram
        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;
                }
            }
        }
コード例 #17
0
 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 { }
 }
コード例 #18
0
ファイル: ChartCell.xaml.cs プロジェクト: UnigramDev/Unigram
        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();
            }
        }
コード例 #19
0
        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;
            }
        }
コード例 #20
0
 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 { }
     }
 }
コード例 #21
0
        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];
        }
コード例 #22
0
        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;
            }
        }