This question is locked. New answers and comments are not allowed.
I'm sure this may be a basic Silverlight question, but I'm needing some help with it.
I've implemented a CellTemplateSelector. I works fine with "static" information, however here's the scenario I really need...
In the Convert() method, I'll return either two values, let's say "true" or "false" for simplicity. In order to determine which value to return, I have to do a comparison between two tables - one table is passed as the "value" parameter in the Convert method and I cast it as such. However, I still need to get the second table. First, there's no way for me to do a view for this in the SQL database because of the complexity of the system and outside factors. So I'm stuck with a few possible solutions and I don't know how to accomplish any of them. Any help is appreciated.
1) Passing (binding) both datasources to the cell, and extracting both through the value parameter in the Convert method
2) Doing an async lookup inside the IValueConverter. Here's the current code:
The problem (I believe) with this, is that the while loop stops the current thread.
3) Return the table and put each one of these cells in a separate thread while showing a busy indicator in the cell and load them each after the inital table load.
Thanks,
Joshua
I've implemented a CellTemplateSelector. I works fine with "static" information, however here's the scenario I really need...
In the Convert() method, I'll return either two values, let's say "true" or "false" for simplicity. In order to determine which value to return, I have to do a comparison between two tables - one table is passed as the "value" parameter in the Convert method and I cast it as such. However, I still need to get the second table. First, there's no way for me to do a view for this in the SQL database because of the complexity of the system and outside factors. So I'm stuck with a few possible solutions and I don't know how to accomplish any of them. Any help is appreciated.
1) Passing (binding) both datasources to the cell, and extracting both through the value parameter in the Convert method
2) Doing an async lookup inside the IValueConverter. Here's the current code:
IEnumerable<Web.Purchase> purchases = null; DomainDataSource domainDS = new DomainDataSource(); domainDS.QueryName = "GetPurchasesQuery"; domainDS.DomainContext = new Web.MyAppContext(); domainDS.LoadedData += (s, e) => { purchases = e.Entities.Cast<Web.Purchase>(); }; domainDS.Load(); while (domainDS.IsLoadingData) {} if (purchases.Count() > 0) return "View"; else return "Purchase";The problem (I believe) with this, is that the while loop stops the current thread.
3) Return the table and put each one of these cells in a separate thread while showing a busy indicator in the cell and load them each after the inital table load.
Thanks,
Joshua