Mai Hu Na

Mai Hu Na

  • NA
  • 86
  • 130.9k

WPF UI update slow Issue

Feb 11 2014 3:16 AM
i used WPF Application to load Files in sql table with different thread.i also update UI Richtext box to know which file is going on loading into table. my code is like
--code on .cs file other then mainpage.cs file
this. MainWindow.displyLog("Files Load started");
--code on mainpage .cs file
public static void displyLog(string message)
{
System.Windows.Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => updateText(message)));
}
then
private static void updateText(string msg)
{
staticLogTxtBox.AppendText(("\n" + msg));
writeToLog(msg);
}
--writeToLog(msg); i used this for create dialylogfile to keep trake which file loaded on which date
--issue
my UI Richtext box got update slowly then Actual files loaded in sql tables.
for example i started 1000 file loading files get loaded in sql table i check using sql query
but after that UP updation keep going on 5-10 min it very bad programming
please suggest solution