private async void importButton_Click(object sender, RoutedEventArgs e) { var openingHandler = new OpeningHandler("Text files (*.txt)|*.txt|All files (*.*)|*.*"); var path = openingHandler.GetPath(); if (path == null || path == "") { return; } await RunLongTask(TextHandler.ImportFromTextFile(processor.Array, xDimension, yDimension, path), () => { ClearArray(); InitializeColorsArray(processor.Array.Max()); RefreshFullArray(); }); }
private async void importTxt_Click(object sender, RoutedEventArgs e) { var openingHandler = new OpeningHandler("Text files (*.txt)|*.txt|All files (*.*)|*.*"); var path = openingHandler.GetPath(); TextHandler.ImportFromTextFile(builder.Array, xDimension, yDimension, path); await Task.Run(() => { renderingArray = new bool[xDimension, yDimension]; Dispatcher.BeginInvoke((Action)(() => { ClearArray(); MakeColorsGrains(builder.Array.Max()); RefreshFullArray(); })); }); }