Setting Window Opacity doesn't work as expected

Sep 17, 2009 at 6:21 PM

Hi, All,

     I have window which is composed of couple of ComboBox and a DataGrid. Data from database will be loaded into DataGrid  based on users' selection from ComboBox. Now what I want to do is set window opacity to .5 before data finder (method) is called (usually it takes about 15 seconds), next set window back to 1.0 when data is completely loaded.

    I find window freezes when data finder is called. Looks like Setting opacity to .5 works after data is loaded into DataGrid (even though I set it before method is called). Why would it work this way? Or should I have to use second Thread to perform data finding? Thanks


Sep 18, 2009 at 9:21 PM

Hi Troy96,

The issue is that you're doing the data load on the same thread as the UI thread.  I recommend using a BackgroundWorker to load your data (data finder).  Namely, it needs to be executed asynchronously.


Saied K.