private async void LoadDataFromFile() { _maxRedniBroj = IraItems.Count > 0 ? IraItems.Max(y => y.RedniBroj) : 0; OpenFileDialog ofd = new OpenFileDialog { Filter = "Xlsx Files *.xlsx|*.xlsx|Xls Files *.xls|*.xls|Csv files *.csv|*.csv", FilterIndex = 1, Multiselect = false }; Nullable <bool> result = ofd.ShowDialog(); if (result != null && result == true) { IsLoading = true; FilePath = ofd.FileName; var data = _xlsFileReader.Convert(FilePath, _bookName); if (data != null) { FromStringToList(data); _loaded = true; } await Application.Current.Dispatcher.BeginInvoke(new Action(DatagridLoaded), DispatcherPriority.ContextIdle, null); } }
private void LoadDataFromFile() { _maxRedniBroj = IraItems.Count > 0 ? IraItems.Max(y => y.RedniBroj) : 0; OpenFileDialog ofd = new OpenFileDialog { Filter = "Xlsx Files *.xlsx|*.xlsx|Xls Files *.xls|*.xls|Csv files *.csv|*.csv", FilterIndex = 1, Multiselect = false }; Nullable <bool> result = ofd.ShowDialog(); if (result != null && result == true) { FilePath = ofd.FileName; var data = _xlsFileReader.Convert(FilePath, _bookName); if (data != null) { FromStringToList(data); _loaded = true; } } }