我想要一个步进器来增加/减少条目中的值。我在网上引用了其他帖子,但是我的增量不起作用。我是否需要代码才能使Entry中的值增加?
a
<Entry BindingContext="{x:Reference stepper}" Text="1" />
<Stepper x:Name="stepper" Minimum="1" Maximum="4" Increment="1"/>
我想要一个步进器来增加/减少条目中的值。我在网上引用了其他帖子,但是我的增量不起作用。我是否需要代码才能使Entry中的值增加?
a
<Entry BindingContext="{x:Reference stepper}" Text="1" />
<Stepper x:Name="stepper" Minimum="1" Maximum="4" Increment="1"/>
you need to bind the Entry's
Text
property to the Stepper'svalue
property您是否需要在条目上写stepper的值?如果那是对的,那么您需要创建一个绑定值,因为当值更改时,您需要“侦听”并将此值放在条目上。
here there is an explain for this.