Wpf binding using Async Factory Method

Wpf binding using Async Factory Method

Old forum URL: forums.lhotka.net/forums/t/6292.aspx


TAC posted on Thursday, January 29, 2009

Hi Rocky,
I made a decision on my project to implement the factory methods the Silverlight way, I saw this to have many advantages for all UIs, not just silverlight. Since I've been involved with a lot of WinForm development I saw it as a great way to keep my forms responsive. However, in Wpf the way the CslaDataProvider has been implemented it expects the FactoryMethod to be sync and it handles being async somewhere else. That means if we're using the Silverlight way there's a fair bit of extra stuff to write in the Code Behind.

Is there any plans to make this easier? maybe a UsesDataPortalResult property which you can set to true and it handles it like in silverlight?

RockfordLhotka replied on Friday, January 30, 2009

In WPF CslaDataProvider you can use the IsAsynchronous="True" property, which integrates automatically with the WPF data binding model.

Because that works so well, I didn't see a need to necessarily have a CslaDataProvider that invokes async factory methods.

I do understand what you are saying, but we'll need to make sure that the Silverlight approach works nicely with the WPF data binding and data provider model.

You should know that Silverlight has no data provider model at all. We invented this on our own to get some level of conceptual parity with WPF. But WPF does have a data provider model, and it is designed with the idea of the IsAsynchronous property.

So the other model may work too, but the IsAsync model is known to work, because that's how the data provider model was designed by Microsoft.

Copyright (c) Marimer LLC