Bagikan melalui


How to: Set Data Binding Properties by Using the Silverlight Designer

Microsoft Silverlight will reach end of support after October 2021. Learn more.

This procedure shows you how to use the Silverlight Designer for Visual Studio 2010 to set properties on a data binding that connects data to a control.

To set properties on a data binding

  1. Create a data binding by using the data binding builder. For more information, see Walkthrough: Creating a Data Binding by Using the Silverlight Designer.

  2. In the Properties window, scroll to the property that has the data binding.

  3. At the edge of the left column, click the property marker (property marker) or inheritance property marker (property marker inheritance icon).

    A menu appears.

    TipTip:

    You can also right-click the row to display the menu.

  4. Click Apply Data Binding.

    The data binding builder appears.

    data binding builder

  5. Click the Options pane.

    Options pane of the data binding builder

  6. Set properties on the data binding by selecting a combination of the following settings.

    Option

    Description

    String Format

    Sets the string format for the binding display value. Click the down-arrow to select from a list of pre-defined formats, or enter your own format. For more information, see Formatting Types.

    Mode

    Sets the Mode property to indicate the BindingMode to use.

    UpdateSourceTrigger

    Sets the UpdateSourceTrigger property to indicate when the target value updates the source.

    NotifyOnValidationError

    Sets the NotifyOnValidationError property to indicate whether errors should raise the BindingValidationError event on the bound object.

    ValidatesOnDataErrors

    Sets the ValidatesOnDataErrors property to indicate whether to report IDataErrorInfo validation errors in the user interface.

    ValidatesOnExceptions

    Sets the ValidatesOnExceptions property to indicate whether to report exception-based validation errors in the user interface. If you select both Validatates on DataErrors and ValidatesOnExceptions, then an exception-based error will replace any IDataErrorInfo-based error in the error report.

    ValidatesOnNotifyDataErrors

    Sets the ValidatesOnNotifyDataErrors property to indicate whether to report INotifyDataErrorInfo validation errors in the user interface.

    Include TargetNullValue

    Sets the TargetNullValue property to indicate the value to use in the target when the value of the source is null.

    BindsDirectlyToSource

    Sets the BindsDirectlyToSource property to indicate whether to ignore any ICollectionView settings on the data source.