disabling a window
- by Arno Greiler
In my application I have a button. If the button is clicked as select against a database is executed and the result is shown in a ListView.
As the select is quite complex, it takes some time to retrieve the data.
When I click the Button, the Application-Window should be disabled until the data is loaded.
But when I set the IsEnabled-Property of the Window to false, the Window gets disabled after the data is loaded.
I tried to disable the Window in an other thread with a BackgroundWorker. But then I get an exception that the Window is alreay in use by an other thread.
How can I disable the Window bevore it retrieves the data?