コード例 #1
0
ファイル: ESIEntry.xaml.cs プロジェクト: bardasoft/UsefulUI
        private static void OnReadOnlyTextColorChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIEntry thisctrl = (ESIEntry)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                //thisctrl.ReadOnlyTextColor = (Color)newValue;
            }
        }
コード例 #2
0
ファイル: ESIEntry.xaml.cs プロジェクト: bardasoft/UsefulUI
        private static void OnRequiredMessageChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIEntry thisctrl = (ESIEntry)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                //thisctrl.RequiredMessage = (string)newValue;
            }
        }
コード例 #3
0
ファイル: ESIEntry.xaml.cs プロジェクト: bardasoft/UsefulUI
        private static void OnReadOnlyPlaceholderChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIEntry thisctrl = (ESIEntry)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                //thisctrl.ReadOnlyPlaceholder = (string)newValue;
            }
        }
コード例 #4
0
ファイル: ESIEntry.xaml.cs プロジェクト: bardasoft/UsefulUI
        private static void OnAsPasswordChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIEntry thisctrl = (ESIEntry)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                thisctrl.fieldValue.IsPassword = (bool)newValue;
            }
        }
コード例 #5
0
ファイル: ESIEntry.xaml.cs プロジェクト: bardasoft/UsefulUI
        private static void OnCanEditChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIEntry thisctrl = (ESIEntry)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                thisctrl.SetVisibility((bool)newValue);
            }
        }
コード例 #6
0
ファイル: ESIEntry.xaml.cs プロジェクト: bardasoft/UsefulUI
        private static void OnBkgColorChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIEntry thisctrl = (ESIEntry)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                thisctrl.fieldPanel.BackgroundColor = (Color)newValue;
            }
        }
コード例 #7
0
ファイル: ESIEntry.xaml.cs プロジェクト: bardasoft/UsefulUI
        private static void OnEntryMarginChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIEntry thisctrl = (ESIEntry)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                thisctrl.fieldValue.Margin        = (Thickness)newValue;
                thisctrl.fieldValueDisplay.Margin = (Thickness)newValue;
            }
        }
コード例 #8
0
ファイル: ESIEntry.xaml.cs プロジェクト: bardasoft/UsefulUI
        private static void OnPlaceHolderChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIEntry thisctrl = (ESIEntry)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                if (newValue != null)
                {
                    thisctrl.fieldValue.Placeholder = (string)newValue;
                }
            }
        }
コード例 #9
0
ファイル: ESIEntry.xaml.cs プロジェクト: bardasoft/UsefulUI
        private static void OnKeyboardTypeChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIEntry thisctrl = (ESIEntry)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                if (newValue != null)
                {
                    switch (newValue.ToString())
                    {
                    case "Chat":
                        thisctrl.fieldValue.Keyboard = Xamarin.Forms.Keyboard.Chat;
                        break;

                    case "Default":
                        thisctrl.fieldValue.Keyboard = Xamarin.Forms.Keyboard.Default;
                        break;

                    case "Email":
                        thisctrl.fieldValue.Keyboard = Xamarin.Forms.Keyboard.Email;
                        break;

                    case "Numeric":
                        thisctrl.fieldValue.Keyboard = Xamarin.Forms.Keyboard.Numeric;
                        break;

                    case "Plain":
                        thisctrl.fieldValue.Keyboard = Xamarin.Forms.Keyboard.Plain;
                        break;

                    case "Telephone":
                        thisctrl.fieldValue.Keyboard = Xamarin.Forms.Keyboard.Telephone;
                        break;

                    case "Text":
                        thisctrl.fieldValue.Keyboard = Xamarin.Forms.Keyboard.Text;
                        break;

                    case "Url":
                        thisctrl.fieldValue.Keyboard = Xamarin.Forms.Keyboard.Url;
                        break;

                    default:
                        thisctrl.fieldValue.Keyboard = Xamarin.Forms.Keyboard.Default;
                        break;
                    }
                }
            }
        }
コード例 #10
0
ファイル: ESIEntry.xaml.cs プロジェクト: bardasoft/UsefulUI
        private static void OnFieldLabelChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIEntry thisctrl = (ESIEntry)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                if (newValue != null)
                {
                    thisctrl.fieldLabel.Text = newValue.ToString();
                }
                else
                {
                    thisctrl.fieldLabel.Text = null;
                }
            }
        }
コード例 #11
0
ファイル: ESIEntry.xaml.cs プロジェクト: bardasoft/UsefulUI
        private static void OnFieldValueChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIEntry thisctrl = (ESIEntry)bindable;

            if (thisctrl != null && oldValue != newValue)
            {
                thisctrl.fieldValue.Text        = newValue?.ToString();
                thisctrl.fieldValueDisplay.Text = newValue?.ToString();
                if (newValue == null)
                {
                    thisctrl.fieldValueDisplay.Text      = thisctrl.PlaceHolder;
                    thisctrl.fieldValueDisplay.TextColor = Color.Gray;
                }
                else
                {
                    thisctrl.fieldValueDisplay.TextColor = Color.Default;
                }
            }
            thisctrl.SetIsRequired(newValue?.ToString());
        }
コード例 #12
0
ファイル: ESIEntry.xaml.cs プロジェクト: bardasoft/UsefulUI
        private static void OnShowRequiredFlagChanged(BindableObject bindable, object oldValue, object newValue)
        {
            ESIEntry thisctrl = (ESIEntry)bindable;

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