![]() ![]() ![]() This is the code of the backgroundworker: Please tell me, how I can solve the problem or identify the bug. In that moment when the event is raised, it is not possible to get or set values to the controls of the window, as I get the following error message: System.InvalidOperationException The calling thread cannot get the object, because it is owned by another thread. This event is handled by a Sub of the class '', which is a code-behind-class of a WPF-Window: 'AddHandler DateilisteAktualisiert, AddressOf PBarFortschritt_ChangeValue'. So the window shall show the analysed filenames and add each new filename to the corresponding listbox, when the 'ReportProgress'-event of the backgroundworker is raised. When I show the Window, eventually not all Word-Documents are loaded. Then it raises the public event 'Public Shared Event DateilisteAktualisiert(ProcessPercentage As Integer)'. This sub adds the dataset to the correct ObservableCollection in the array 'Dateilisten()'. With myWorker.reportprogress I deliver each set of data ('myDataset') to the sub 'ReportProgress': 'Private Shared Sub ReportProgress(ByVal sender As System.Object, ByVal e As ProgressChangedEventArgs) Handles MyWorker.ProgressChanged'. The array is part of a class 'Worddatei', that represents the properties of the word-files. ![]() With the start of the word-application I start a backgroundworker, that collects the important data of each document and stores them in a Dictionary(Of String, String).Īll datasets are stored in an array of three ObservableCollections, one for each path/group of documents: 'Public Shared Dateilisten(2) As ObservableCollection(Of Dictionary(Of String, String))' I want to select documents by different properties, e.g. I have three folders with word-documents (.docx), each more than 100 documents.Įach folder contents documents with a different theme. I hope, that you can help me with my problem. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |