Partager via


Reuse sample data in other projects

The easiest ways to reuse sample data in multiple projects are to duplicate your project or to create an XML file to represent your data and import the XML file into each project.

For more information, see Create a duplicate project or Import sample data from an XML file.

Alternatively, you can add the folder of generated sample data to another project to reuse the data that it contains. This procedure requires more steps than importing an XML file, but you might find yourself in a situation where you need to reuse generated data.

To reuse generated sample data files in other projects

  1. In the project to which you want to copy the sample data, create a new sample data source, giving it the same name as the data source that you want to copy.

  2. In the Projects panel, expand the SampleData folder, right-click the folder that contains the XAML and XSD files, and then click Add Existing Item.

  3. In the Add Existing Item dialog box, browse to the project folder from which you want to copy the data, expand the SampleData folder, browse to the data source folder that contains the XAML and XSD files that you want, select all the items (there might be a folder of images in addition to the XAML and XSD files, so select that also), and then click Open.

  4. In the Overwrite files dialog box, click Yes.

  5. When you see the message about a file being modified outside Blend, click Yes.

  6. Save the project and close it.

  7. Open the project again. You will see the new schema in the Data panel.

Voir aussi

Tâches

Import sample data from an XML file

Modify sample data

Autres ressources

Displaying data in controls