Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Bind keyboard type in XAML?

$
0
0

On one Page, need to display either the standard or numeric keyboard, depending on a property of our PageModel.
We were hoping that the following would work.

XAML:

<Entry x:Name="AnswerEntry" Grid.Row="2" Style="{StaticResource entryStyle}" HorizontalTextAlignment="Start" Keyboard="{Binding KeyboardType}" Text="{Binding AnswerValue}" />

PageModel:

                switch (this.PageParams.Question.ChaType)
                {
                    // N = Integer numeric
                    case "N":
                    // V = Decimal numeric
                    case "V":
                        this.KeyboardType = Keyboard.Numeric;
                        break;
                    default:
                        this.KeyboardType = Keyboard.Text;
                        break;
                }

However, I'm only getting a default keyboard.

I'm implementing INotifyPropertyChanged etc. - other properties/controls are working.

Do I have to bind differently for Keyboard? Is it bindable?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>