巨大なテキスト ファイルを読み取ってテキスト ボックスに表示する WPF アプリケーションがありますが、正規化ボタンを表示に変更する前に、すべてのファイルが読み取られていることを確認する必要があります。
私の質問は、すべてのファイルが読み取られてテキストボックスに表示されたことをどのように知ることができますか (テキストボックスがまだ変更されていることを意味します)、ボタンを表示に割り当てた直後ですか?
try
{
OpenFileDialog openFileDialog = new OpenFileDialog();
if (openFileDialog.ShowDialog() == true)
{
using (StreamReader sr = new StreamReader(openFileDialog.FileName))
{
FileBuff = await sr.ReadToEndAsync();
txtEditor.Text = FileBuff;
Normalize_button.IsEnabled = true;
}
}
}
catch (Exception ex)
{
UiInvoke(() => txtEditor.Text = "Could not read the file");
}