我在 windows phone 8.1 上开发了一个应用程序。当事件被触发时不发送 eventArgs。为什么?在旧解决方案 WP 8.0 中,此语法工作正常......
<TextBox x:Name="Amount" Grid.Row="2" Grid.Column="1" InputScope="Number" Header="{Binding TbAmount}" micro:Message.Attach="[Event KeyUp] = [Action NumericKeyboard_OnKeyUp($source, $eventArgs)]"/>
这是事件处理程序:
public void NumericKeyboard_OnKeyUp(object sender, KeyEventArgs e)
{
if (CultureInfo.CurrentCulture.ToString() != "en-US")
return;
if (e.VirtualKey == VirtualKey.None)
{
var distanceTb = sender as TextBox;
distanceTb.Text = distanceTb.Text.Replace(",", ".");
// reset cursor position to the end of the text (replacing the text will place
// the cursor at the start)
distanceTb.Select(distanceTb.Text.Length, 0);
}
}