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(); }
private static void OnDateTitleChanged(BindableObject bindable, object oldValue, object newValue) { ESIDateAndTime thisctrl = (ESIDateAndTime)bindable; if (thisctrl != null && oldValue != newValue) { thisctrl.dateTitle.Text = newValue.ToString(); } }
private static void OnRequiredMessageChanged(BindableObject bindable, object oldValue, object newValue) { ESIDateAndTime thisctrl = (ESIDateAndTime)bindable; if (thisctrl != null && oldValue != newValue) { //thisctrl.RequiredMessage = (string)newValue; } }
private static void OnTimeFormatChanged(BindableObject bindable, object oldValue, object newValue) { ESIDateAndTime thisctrl = (ESIDateAndTime)bindable; if (thisctrl != null && oldValue != newValue) { thisctrl.timeComponent.Format = (string)newValue; } }
private static void OnAllowFutureDateChanged(BindableObject bindable, object oldValue, object newValue) { ESIDateAndTime thisctrl = (ESIDateAndTime)bindable; if (thisctrl != null && oldValue != newValue) { //thisctrl.AllowFutureDate = (bool)newValue; } }
private static void OnCanEditChanged(BindableObject bindable, object oldValue, object newValue) { ESIDateAndTime thisctrl = (ESIDateAndTime)bindable; if (thisctrl != null && oldValue != newValue) { thisctrl.SetVisibility((bool)newValue); } }
private static void OnReadOnlyDateTimeTextColorChanged(BindableObject bindable, object oldValue, object newValue) { ESIDateAndTime thisctrl = (ESIDateAndTime)bindable; if (thisctrl != null && oldValue != newValue) { //thisctrl.ReadOnlyDateTimeTextColor = (Color)newValue; } }
private static void OnReadOnlyDateTimePlaceHolderChanged(BindableObject bindable, object oldValue, object newValue) { ESIDateAndTime thisctrl = (ESIDateAndTime)bindable; if (thisctrl != null && oldValue != newValue) { //thisctrl.ReadOnlyDateTimePlaceHolder = (string)newValue; } }
private static void OnReadOnlyTitleChanged(BindableObject bindable, object oldValue, object newValue) { ESIDateAndTime thisctrl = (ESIDateAndTime)bindable; if (thisctrl != null && oldValue != newValue) { thisctrl.readOnlyTitle.Text = (string)newValue; } }
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; } }
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; } } }
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; } } }