FarsiLibrary.WPF.Controls.FXDatePicker.DoFormat C# (CSharp) Метод

DoFormat() приватный Метод

private DoFormat ( System.DateTime date ) : string
date System.DateTime
Результат string
        internal string DoFormat(DateTime? date)
        {
            string text;

            if (date.HasValue)
            {
                object o;
                if (DateConverter != null)
                {
                    o = DateConverter.Convert(date.Value, typeof(string), null, CultureHelper.CurrentCulture);
                }
                else
                {
                    o = defaultConverter.Convert(date.Value, typeof(string), null, CultureHelper.CurrentCulture);
                }

                text = Convert.ToString(o, CultureHelper.CurrentCulture);
            }
            else
            {
                text = NullValueText;
            }

            SetValue(TextPropertyKey, text);
            return text;
        }

Same methods

FXDatePicker::DoFormat ( ) : void

Usage Example

Пример #1
0
        private static void OnNullValueTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            FXDatePicker datepicker = (FXDatePicker)d;

            if (!datepicker.SelectedDateTime.HasValue)
            {
                datepicker.DoFormat(null);
            }
        }
All Usage Examples Of FarsiLibrary.WPF.Controls.FXDatePicker::DoFormat