예제 #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;
                }
            }
        }