Skip to content

Creates a WPF SlideView control and binds it to a data source to display a horizontal list of items with slide navigation.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/create-wpf-slide-view

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WPF SlideView – Display a Horizontal List of Cards with Swipe Navigation

This example uses the SlideView control to display a scrollable horizontal list of items. Each item is rendered as a content card with user-defined templates.

Group Bar Items with Separators

Use the SlideView control when you need to:

  • Display detailed information for data items in a focused, single-item view.
  • Create a modern, user-friendly interface with swipe-style navigation.

Implementation Details

Data Structure

The data source, which contains a list of Employee objects, is exposed by the EmployeesData view model through the DataSource property. The Employee class exposes employee-related properties (such as FullName, Photo, JobTitle, EmailAddress, and City). Images are stored as byte arrays and converted to BitmapImage objects at runtime.

public class Employee {
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string FullName => FirstName + " " + LastName;
    public string JobTitle { get; set; }
    public string EmailAddress { get; set; }
    public string City { get; set; }
    public byte[] ImageData { get; set; }

    [XmlIgnore]
    public BitmapImage Photo => imageSource ??= LoadImage();

    BitmapImage LoadImage() {
        var stream = new MemoryStream(ImageData);
        var image = new BitmapImage();
        image.BeginInit();
        image.StreamSource = stream;
        image.EndInit();
        return image;
    }
}

Templates

The following code example defines two templates:

<DataTemplate x:Key="ItemHeaderTemplate">
    <TextBlock Text="{Binding FirstName}" />
</DataTemplate>

<DataTemplate x:Key="ItemContentTemplate">
    <Grid>
        <!-- Photo, FullName, JobTitle, etc. -->
    </Grid>
</DataTemplate>

Slide View Configuration

<dxwui:SlideView
    Header="Slide View"
    ItemsSource="{Binding DataSource}"
    ItemHeaderTemplate="{StaticResource ItemHeaderTemplate}"
    ItemTemplate="{StaticResource ItemContentTemplate}" />

Files to Review

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Creates a WPF SlideView control and binds it to a data source to display a horizontal list of items with slide navigation.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 6

Languages