Properties and GUI changes
-
Is it better to have an AIP and subscribe to a changed event to update the GUI when the property changes, or to specify a backing field and add the GUI update code to the set method? Thanks, Sam
-
Is it better to have an AIP and subscribe to a changed event to update the GUI when the property changes, or to specify a backing field and add the GUI update code to the set method? Thanks, Sam
I Hope i understood u :) it is always better to Subscibre to an event when a Property is Changed if it's your Property Like public int MyPropery { Get {return myPropery;} Set {myPropery = value;//Do Something according to the Cahnge//} } Hope i could Help :)
Have Fun Never forget it
-
Is it better to have an AIP and subscribe to a changed event to update the GUI when the property changes, or to specify a backing field and add the GUI update code to the set method? Thanks, Sam
there exist is a big conversation about this . has to do with mvc architecture .if you want standard .net framework look at microsoft databinding . every control has a data binding list .you can unify the way bi directional notification is made use code like this textBox.DataBindings.Add("Text",object,object.property); wich means syncronize the textbox .text with the object.property it is a dificult subject but worth it . or use the code the friend just gave you. http://www.codeproject.com/KB/database/databindingconcepts.aspx[^] http://msdn2.microsoft.com/en-us/library/ms752347.aspx[^]
f(yf) = yf
modified on Thursday, March 27, 2008 4:33 PM