With the IBM Database Add-Ins for Visual Studio, you can generate a sample XAML
application for an IBM data source. You can then use the code in the sample
application as a template for adding IBM data sources to your own XAML
applications.
When you generate a sample XAML application, the following actions occur:
A WPF Application project is created.
A reference to an IBM data provider is added to the project.
A strongly typed dataset is added to the project, with the selected data table.
XAML code is generated in the Window1.xaml file that defines all of the UI
elements in a sample design.
In the UI generation process, each control is assigned its associated data
member.
C# code is generated and the dataset is initialized in the Window1.xaml.cs
code-behind file.
A new BindingSource object is created in the code-behind file for the Window1
form, and the dataset is assigned to the DataSource property.
After the BindingSource is initialized with the dataset in code, additional
generated code loads the table so that the sample application can access its
fields.
BindingSource is assigned to the data context of the main grid, which is the
main container control that holds all of the child controls in the form.
BindingSource is also assigned to the DataSource property of the list box and
the grid control.
After the code binds all of the controls to BindingSource object, all of the
fields are accessible in the XAML code of the Window1.xaml file.
You can run the application to see the controls in the sample XAML application
populated with values from the selected database object.
Note: Sample XAML applications are generated by using
functionality in the Microsoft® Visual J#® 2.0
Redistributable Package - Second Edition (x86). Full information about the
package, including download instructions, is available on the
Microsoft Visual J# 2.0 Redistributable Package - Second Edition (x86) Web
page.