使keyup事件更具响应性

时间:2013-10-26 05:43:14

标签: wpf keyup

 <TextBox FocusManager.FocusedElement="{Binding RelativeSource={RelativeSource Self}}"   TextWrapping="Wrap" Visibility="Collapsed" ScrollViewer.VerticalScrollBarVisibility="Visible"  Grid.Row="0" x:Name="sessionNoteContent" KeyUp="SaveNote">

 private void SaveNote(object sender, KeyEventArgs e)
    {
        if (e.Key == Key.Enter)
        {
            if (String.IsNullOrWhiteSpace(sessionNoteContent.Text))
            {

            }
            else
            {
                Class1 note = new Class1 ()
                       {
                        time1=timeElapsed,
                        Notes = sessionNoteContent.Text, 
                        StartTime = sessionStartTime, 
                       CurrentTimestamp = DateTime.Now,
                       TeamId = teamId,
                 };
                repo.InsertSessionNote(note);
                sessionNoteListData.Add(note);



                sessionNoteContent.Text = "";



            }
            sessionNoteContent.Visibility = System.Windows.Visibility.Collapsed;
            sessionNotesList.Visibility = System.Windows.Visibility.Visible;
        }

我已在文本框中处理了关键事件。当我输入时,它会减慢字符的显示速度。有没有办法处理它。使用wpf桌面应用程序。

0 个答案:

没有答案