Пример #1
0
        protected override void OnFocusChanged(bool gainFocus, [GeneratedEnum] FocusSearchDirection direction, Rect previouslyFocusedRect)
        {
            base.OnFocusChanged(gainFocus, direction, previouslyFocusedRect);

            if (gainFocus)
            {
                SetFilters(inputFilters);

                if ((InputType & InputTypes.NumberFlagDecimal) != 0 && !string.IsNullOrEmpty(Text))
                {
                    var convertedValue = ViewModelValueConverter.ConvertBack <CurrencyValueConverter, double?>(Text);

                    if (convertedValue != null)
                    {
                        Text = convertedValue.Value.ToString(CurCult.CurrentCulture);
                    }
                }
            }
            else
            {
                SetFilters(EmptyInputFilters);

                if ((InputType & InputTypes.NumberFlagDecimal) != 0 && !string.IsNullOrEmpty(Text))
                {
                    var convertedValue = ViewModelValueConverter.ConvertBack <CurrencyValueConverter, double?>(Text);

                    if (convertedValue != null)
                    {
                        Text = ViewModelValueConverter.Convert <CurrencyValueConverter>(convertedValue);
                    }
                }

                FocusOut?.Invoke(this, EventArgs.Empty);
            }
        }
Пример #2
0
 protected virtual void OnFocusOut()
 {
     if (FocusOut != null)
     {
         FocusOut.Invoke(this, System.EventArgs.Empty);
     }
 }