WPF MVVM ListView does not update! -
i'm using prism v4 , , mvvm. in viewmodel have:
private tb_company tb; public tb_company tb { { return this.tb; } private set { if ( this.tb != value ) { this.tb = value; this.raisepropertychanged(() => this.tb); } } }
in page, have datagrid (i tried listview too, don't work!):
<datagrid itemssource="{binding tb.tb_address.rl_address_phone}" .../>
rl_address_phone list of phones of company... so, in moment add phone list:
private void mycommand() { ... tb.tb_address.rl_address_phone.add( new rl_address_phone { tb_phone = new tb_phone { nu_phone = _txttelefone, st_type = _txttipotelefone } }); ... }
but nothing happens ui... in debug, list fullfiled.... should update ui?
the rl_address_phone
property of tb_address
must implement inotifypropertychanged
well. if list
, should use observablecollection
implements inotifycollectionchanged
necessary behaviour trying achieve.
also, piece of advise - have design guidelines , naming convention of c# language, can find in msdn (while says .net 1.1, still applies following versions of framework).
Comments
Post a Comment