0
 <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;
        }

我已经在我的 texbox 上处理了按键事件。当我键入时,它会减慢字符的显示速度。有什么办法可以处理。在 wpf 桌面应用程序上工作。

4

0 回答 0