Пример #1
0
        private static void OnSelectedDateTimeChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIDateAndTime thisctrl = (ESIDateAndTime)bindable;

            if (thisctrl == null)
            {
                return;
            }

            if (newValue != null)
            {
                if (oldValue != newValue && thisctrl.dateComponent != null)
                {
                    try
                    {
                        if (thisctrl.modelDateTime != null)
                        {
                            thisctrl.timeComponent.Time        = thisctrl.modelDateTime.TimeOfDay;
                            thisctrl.dateComponent.Date        = thisctrl.modelDateTime.Date;
                            thisctrl.dateComponent.MaximumDate = thisctrl.AllowFutureDate ? new DateTime(2100, 12, 31) : DateTime.Now;
                            thisctrl.SelectedDateChanged();
                        }
                        return;
                    }
                    catch (Exception ex)
                    {
                        Debug.WriteLine(ex.Message);
                    }
                }
            }
            thisctrl.CanEdit = false;
            thisctrl.SelectedDateChanged();
        }
Пример #2
0
        private static void OnDateTitleChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIDateAndTime thisctrl = (ESIDateAndTime)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                thisctrl.dateTitle.Text = newValue.ToString();
            }
        }
Пример #3
0
        private static void OnRequiredMessageChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIDateAndTime thisctrl = (ESIDateAndTime)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                //thisctrl.RequiredMessage = (string)newValue;
            }
        }
Пример #4
0
        private static void OnTimeFormatChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIDateAndTime thisctrl = (ESIDateAndTime)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                thisctrl.timeComponent.Format = (string)newValue;
            }
        }
Пример #5
0
        private static void OnAllowFutureDateChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIDateAndTime thisctrl = (ESIDateAndTime)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                //thisctrl.AllowFutureDate = (bool)newValue;
            }
        }
Пример #6
0
        private static void OnCanEditChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIDateAndTime thisctrl = (ESIDateAndTime)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                thisctrl.SetVisibility((bool)newValue);
            }
        }
Пример #7
0
        private static void OnReadOnlyDateTimeTextColorChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIDateAndTime thisctrl = (ESIDateAndTime)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                //thisctrl.ReadOnlyDateTimeTextColor = (Color)newValue;
            }
        }
Пример #8
0
        private static void OnReadOnlyDateTimePlaceHolderChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIDateAndTime thisctrl = (ESIDateAndTime)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                //thisctrl.ReadOnlyDateTimePlaceHolder = (string)newValue;
            }
        }
Пример #9
0
        private static void OnReadOnlyTitleChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIDateAndTime thisctrl = (ESIDateAndTime)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                thisctrl.readOnlyTitle.Text = (string)newValue;
            }
        }
Пример #10
0
        private static void OnDateAndTimeMarginChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIDateAndTime thisctrl = (ESIDateAndTime)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                thisctrl.dateComponent.Margin    = (Thickness)newValue;
                thisctrl.readOnlyDateTime.Margin = (Thickness)newValue;
            }
        }
Пример #11
0
        private static void OnReadOnlyDateTimeFormatChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIDateAndTime thisctrl = (ESIDateAndTime)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                if (thisctrl.SelectedDateTime.HasValue)
                {
                    thisctrl.readOnlyDateTime.Text      = thisctrl.SelectedDateTime.Value.ToString((string)newValue);
                    thisctrl.readOnlyDateTime.TextColor = thisctrl.ReadOnlyDateTimeTextColor;
                }
                else
                {
                    thisctrl.readOnlyDateTime.Text      = thisctrl.ReadOnlyDateTimePlaceHolder;
                    thisctrl.readOnlyDateTime.TextColor = thisctrl.ReadOnlyDateTimePlaceholderColor;
                }
            }
        }
Пример #12
0
        private static void OnShowRequiredFlagChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIDateAndTime thisctrl = (ESIDateAndTime)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                thisctrl.required.IsVisible = (bool)newValue;
                if ((bool)newValue)
                {
                    if (!thisctrl.SelectedDateTime.HasValue)
                    {
                        thisctrl.required.Text = thisctrl.RequiredMessage;
                    }
                    else
                    {
                        thisctrl.required.Text = null;
                    }
                }
                else
                {
                    thisctrl.required.Text = null;
                }
            }
        }