TypedView/TypedList as POCO & WPF binding

Posts   
 
    
YvesVD
User
Posts: 177
Joined: 19-Oct-2006
# Posted on: 04-Nov-2014 13:34:39   

Hi,

I like the idea of generating POCO's for my TypedViews but as I see it the INotifyPropertyChanged is not implemented. So, the binding with WPF will not work. Is it possible to force the implementation of INotifyPropertyChanged or to bypass that issue ?

Thanks

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 04-Nov-2014 15:56:00   

Are you using LLBLGen Pro v.3.5 as in the signature or v.4.2?

(Edit) If the later, are you configuring the outputType to have a Poco with linq or querySpec?

And the last question would be, you need the INotifyPropertyChanged, implemented on the [TypedViewName]Row class, correct?

If so then you can modify the responsible shipped template (typedViewRowClass.lpt) to implement the interface.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 04-Nov-2014 16:52:15   

It's not implemented as typedviews are considered 'readonly' so binding does work but there's no notification of change of the value if the property changes (control bound to it isn't updated). You're using them as read/write?

Frans Bouma | Lead developer LLBLGen Pro
YvesVD
User
Posts: 177
Joined: 19-Oct-2006
# Posted on: 05-Nov-2014 08:00:37   

Walaa wrote:

Are you using LLBLGen Pro v.3.5 as in the signature or v.4.2?

I'm using 4.1 but I'm considering migrating to 4.2

(Edit)

Walaa wrote:

If the later, are you configuring the outputType to have a Poco with linq or querySpec?

Yes, I did a test with querySpec.

Walaa wrote:

And the last question would be, you need the INotifyPropertyChanged, implemented on the [TypedViewName]Row class, correct?

If so then you can modify the responsible shipped template (typedViewRowClass.lpt) to implement the interface.

I thought that there could be a proper way of doing that because I don't like to modify the original templates.

YvesVD
User
Posts: 177
Joined: 19-Oct-2006
# Posted on: 05-Nov-2014 09:04:48   

Otis wrote:

It's not implemented as typedviews are considered 'readonly' so binding does work but there's no notification of change of the value if the property changes (control bound to it isn't updated). You're using them as read/write?

The TypedViews I'm using are coming from Oracle cursors and not views. The reads and writes are done in packages. So, the updated TypedView fields need to be used for the update procedure.

I overcome the readonly problem of TypedViews by setting all columns to readonly equal false. I'd like to use Poco's because it would mean less hacking on TypedViews. You could maybe add a 4th outputType called BindablePoco which would implement the INotificationPropertyChanged.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 06-Nov-2014 15:18:25   

YvesVD wrote:

Otis wrote:

It's not implemented as typedviews are considered 'readonly' so binding does work but there's no notification of change of the value if the property changes (control bound to it isn't updated). You're using them as read/write?

The TypedViews I'm using are coming from Oracle cursors and not views. The reads and writes are done in packages. So, the updated TypedView fields need to be used for the update procedure.

Ah, ok, but then you want change tracking as well, so more than just INotifyPropertyChanged, which simply raises an event.

I overcome the readonly problem of TypedViews by setting all columns to readonly equal false. I'd like to use Poco's because it would mean less hacking on TypedViews. You could maybe add a 4th outputType called BindablePoco which would implement the INotificationPropertyChanged.

Though that interface (and functionality) won't help you with sending changes back to the db, I'm afraid: change tracking requires more than just an event. How are you planning to do the updates / inserts?

Frans Bouma | Lead developer LLBLGen Pro