【问题标题】:How to check when the user is typing in Xamarin Forms?如何检查用户何时输入 Xamarin Forms?
【发布时间】:2020-03-03 16:41:29
【问题描述】:

我是 Xamarin Forms 的新手,我想检查用户何时键入,以便更改按钮的文本

<Entry IsPassword="True"
       Placeholder="password"
       Style="{StaticResource InputStyle}"
       Text=""
       Margin="16,0,16,0">

<Button BorderColor="orange"
        TextColor="{black"
        Command="{Binding LoginCommand}"
        Text="{Binding ButtonText}"
        Margin="25,0,25,0"/>

【问题讨论】:

  • 有一个 Entry.TextChanged 事件被调用

标签: xamarin xamarin.forms xamarin.android xamarin.ios


【解决方案1】:

在您的 xaml 中添加 TextChanged event

<Entry IsPassword="True"
       Placeholder="password"
       Style="{StaticResource InputStyle}"       
       TextChanged="Entry_TextChanged"
       Margin="16,0,16,0">

并将其添加到页面后面的代码中以捕获它:

void Entry_TextChanged(System.Object sender, TextChangedEventArgs e)
{
    //do something here
}

【讨论】:

    猜你喜欢
    • 2018-07-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多