wpf-15029-controls-and-libraries-windows-modern-ui-examples-how-to-create-a-flipview-and-populate-it-with-data.md
This example demonstrates how to create a Flip View, bind it to data and use templates to visualize its items. The last section of this example contains the complete example code.
Start Visual Studio and create a new WPF project by selecting FILE | New | Project… in the main menu. In the invoked New Project window, select WPF Application , change the name to FlipViewSample , and click OK.
Change the main window’s theme to Office 2013. To do so, reference the DevExpress Core namespace and use the ThemeManager.
Locate the FlipView control in the Toolbox and drop it onto the form. Once added, the FlipView automatically generates two FlipViewItem objects. These items are not required, so remove them from the XAML mark-up.
Define the data source in XAML.
Now create a DataTemplate object in the Resources section. This data template will specify how items within our FlipView should appear.
Finally, assign the data template to the FlipView’s ItemTemplate property. Use the ItemsSource property to set a data source for the FlipView.
You can now launch the application and see the results. Remember to include the code for classes encapsulating the data source, which can be found below. The .XML file that stores employee data is also listed later in this example. Include this file in your project and set its BuildAction property to EmbeddedResource.
This example shows how to create a FlipView , populate it from a data source and customize its items via data templates.