Testing the Control Data Binding Changes

Because the Note property uses optimistic data binding, the Circle control assumes that all changes to the Note property are allowed. The SetNote function simply changes the Note property and notifies the container by calling the BoundPropertyChanged function. This notification displays in Test Container's Notification Log dialog box.

To test the control data binding changes

  1. On the Tools menu, click ActiveX Control Test Container.

  2. Use the Logging option in the Options menu to ensure that output information is going to either a window or file.

  3. On the Edit menu, click Insert New Control.

    The Insert Control dialog box appears.

  4. From the list box, select Circ Control.

  5. Click OK to close the Insert Control dialog box and insert the control into Test Container.

  6. On the Edit menu, select the Properties option.

    The Circ Control Properties dialog box appears.

  7. Enter a new value for the Note property and click Apply.

    The Note property is displayed in the control.

    Information about the change to the Note property appears as shown below:

    Circ3 Control: Property Change: Note
    

    This kind of information appears every time the BoundPropertyChanged function is called for a bound property. The line shows the type and the property name, and states that the property has changed.

  8. Change the Note property several more times and observe the logged information. Close Test Container when you are finished.

Using the BoundPropertyChanged function to notify the container of changes to bound properties, illustrates the simplest level of data binding.