mrbar2000
unread,Mar 25, 2009, 1:35:21 PM3/25/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Infra - Integrated Frameworks
Oi pessoal, venho pensando em como fazer binding de objetos mais
complexos como combox, listbox, listview.
Estava pensando em termos interfaces diferentes para tratamento de
listas (BindingList e BindableList)
// temos infraobject instanciado chamado pessoa e possui uma atributo
IEnderecos (Infralist) chamada endereços.
bm := BindingService.GetNewBindManager;
bm.DataContext := pessoa;
// Amarrando Nome ao Edit
bm.Add('Nome', Edit1, 'Text').TwoWay;
// Amarrando Endereços da pessoa a um ListBox
bl := bm.Add('Enderecos', ListBox1, 'Items');
(bl as IBindingList).Items.Add('Rua');
// Amarrando Endereços da pessoa a um Listview
bl := bm.Add('Enderecos', ListView1, 'Items');
with (bl as IBindingList).Items do
begin
Add('Rua');
Add('Numero', TNumerToTextConverter.Create);
Add('Cidade.Nome');
end;
o que acham?
------------------------
Hi Guys, I thinking about how binding of more complex objects as
combox, listbox, listview.
I was thinking in different interfaces for lists treatment
(BindingList and BindableList)
/ / We have instantiated infraobject named person and has a IAddresses
attribute (Infralist) call Addresses.
bm: = BindingService.GetNewBindManager;
bm.DataContext: = person;
/ / Name Tied to Edit
bm.Add( 'Name', Edit1, 'Text'). TwoWay;
/ / Address of the person tying a ListBox
bl: = bm.Add( 'Addresses', ListBox1, 'Items');
(bl the IBindingList).Items.Add('Street');
/ / Address of the person tying a ListView
bl: = bm.Add ('Addresses', ListView1, 'Items');
with (bl as IBindingList).Items do
begin
Add('street');
Add('Number', TNumerToTextConverter.Create);
Add('City.Name');
end;
what do you think?