Reputation: 15
I have code like this but when i run it show ":
Synchronous operations should not be performed on the UI thread. Consider wrapping this method in Task.Run
How can i resolve this ? Thanks
public guchi()
{
string[] list = File.ReadAllLines(@"C:\Users\sample.csv");
foreach (string item in list)
{
var tmp = item.Split(';');
this.Add(new guchi()
{
test = tmp[0],
fun = tmp[1],
happy = tmp[2],
run = tmp[3],
now = tmp[4],
god = tmp[5],
time = tmp[6],
final= tmp[7],
Pyke = tmp[8],
Xinzhao = tmp[9]
});
}
}
Upvotes: 0
Views: 174