October 2010
Intermediate to advanced
1920 pages
73h 55m
English
You can define a property for a component in two ways: the lazy way and the virtuous way. The lazy way to create a property is to create a public field. If you declare any field with the Public access modifier, the field can be accessed from outside the component. For example, the component in Listing 17.6 contains a public field named Message.
Listing 17.6. FieldHelloWorld.cs

The Message field is declared near the top of the FieldHelloWorld class definition. The Message field is returned by the SayMessage() method.
The page in Listing 17.7 uses the FieldHelloWorld component to display a message.
Listing 17.7. ...
Read now
Unlock full access