Exemplo n.º 1
0
        protected override void OnElementChanged(ElementChangedEventArgs <DatePicker> e)
        {
            if (Control == null)
            {
                var entry = new Native.EditfieldEntry(Forms.NativeParent)
                {
                    IsSingleLine             = true,
                    HorizontalTextAlignment  = Native.TextAlignment.Center,
                    InputPanelShowByOnDemand = true,
                };
                entry.SetVerticalTextAlignment("elm.text", 0.5);
                entry.TextBlockFocused += OnTextBlockFocused;
                SetNativeControl(entry);

                _lazyDialog = new Lazy <DateTimePickerDialog <Native.DatePicker> >(() =>
                {
                    var dialog = new DateTimePickerDialog <Native.DatePicker>(Forms.NativeParent)
                    {
                        Title = DialogTitle
                    };
                    dialog.DateTimeChanged += OnDateTimeChanged;
                    return(dialog);
                });
            }
            base.OnElementChanged(e);
        }
Exemplo n.º 2
0
 protected override void OnElementChanged(ElementChangedEventArgs <Entry> e)
 {
     if (Control == null)
     {
         var entry = new Native.EditfieldEntry(Forms.NativeParent)
         {
             IsSingleLine = true,
         };
         entry.SetVerticalTextAlignment("elm.text", 0.5);
         entry.SetVerticalTextAlignment("elm.guide", 0.5);
         entry.TextChanged += OnTextChanged;
         entry.Activated   += OnCompleted;
         entry.PrependMarkUpFilter(MaxLengthFilter);
         SetNativeControl(entry);
     }
     base.OnElementChanged(e);
 }