Skip to content

Commit 7f1ee1c

Browse files
Merge pull request #1 from sergepilipchuk/sp-update-readme-24-2-1
Update Readme file
2 parents d2564a1 + 74fcc8a commit 7f1ee1c

File tree

2 files changed

+89
-11
lines changed

2 files changed

+89
-11
lines changed

Images/slide-view.jpg

221 KB
Loading

Readme.md

Lines changed: 89 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,102 @@
44
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
55
[![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)
66
<!-- default badges end -->
7-
<!-- default file list -->
8-
*Files to look at*:
7+
8+
# WPF SlideView – Display a Horizontal List of Cards with Swipe Navigation
9+
10+
This example uses the [`SlideView`](https://docs.devexpress.com/WPF/DevExpress.Xpf.WindowsUI.SlideView) control to display a scrollable horizontal list of items. Each item is rendered as a content card with user-defined templates.
11+
12+
![Group Bar Items with Separators](./Images/slide-view.jpg)
13+
14+
Use the [`SlideView`](https://docs.devexpress.com/WPF/DevExpress.Xpf.WindowsUI.SlideView) control when you need to:
15+
16+
- Display detailed information for data items in a focused, single-item view.
17+
- Create a modern, user-friendly interface with swipe-style navigation.
18+
19+
## Implementation Details
20+
21+
### Data Structure
22+
23+
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.
24+
25+
```csharp
26+
public class Employee {
27+
public string FirstName { get; set; }
28+
public string LastName { get; set; }
29+
public string FullName => FirstName + " " + LastName;
30+
public string JobTitle { get; set; }
31+
public string EmailAddress { get; set; }
32+
public string City { get; set; }
33+
public byte[] ImageData { get; set; }
34+
35+
[XmlIgnore]
36+
public BitmapImage Photo => imageSource ??= LoadImage();
37+
38+
BitmapImage LoadImage() {
39+
var stream = new MemoryStream(ImageData);
40+
var image = new BitmapImage();
41+
image.BeginInit();
42+
image.StreamSource = stream;
43+
image.EndInit();
44+
return image;
45+
}
46+
}
47+
```
48+
49+
### Templates
50+
51+
The following code example defines two templates:
52+
53+
* [`ItemHeaderTemplate`](https://docs.devexpress.com/WPF/DevExpress.Xpf.WindowsUI.SlideView.ItemHeaderTemplate) displays the employee’s first name.
54+
* [`ItemContentTemplate`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Docking.LayoutGroup.ItemContentTemplate) displays detailed information, including photo, contact details, and job data.
55+
56+
```xaml
57+
<DataTemplate x:Key="ItemHeaderTemplate">
58+
<TextBlock Text="{Binding FirstName}" />
59+
</DataTemplate>
60+
61+
<DataTemplate x:Key="ItemContentTemplate">
62+
<Grid>
63+
<!-- Photo, FullName, JobTitle, etc. -->
64+
</Grid>
65+
</DataTemplate>
66+
```
67+
68+
### Slide View Configuration
69+
70+
```xaml
71+
<dxwui:SlideView
72+
Header="Slide View"
73+
ItemsSource="{Binding DataSource}"
74+
ItemHeaderTemplate="{StaticResource ItemHeaderTemplate}"
75+
ItemTemplate="{StaticResource ItemContentTemplate}" />
76+
```
77+
78+
## Files to Review
979

1080
* [DataStorage.cs](./CS/SlideViewSample/DataStorage.cs)
11-
* **[MainWindow.xaml](./CS/SlideViewSample/MainWindow.xaml)**
12-
<!-- default file list end -->
13-
# WPF SlideView - Display a horizontal list of items with slide navigation
81+
* [MainWindow.xaml](./CS/SlideViewSample/MainWindow.xaml)
1482

83+
## Documentation
1584

16-
<p>This example demonstrates how to create a SlideView, bind it to data and use templates to visualize its items. </p>
85+
* [SlideView](https://docs.devexpress.com/WPF/DevExpress.Xpf.WindowsUI.SlideView)
86+
* [SlideViewItem](https://docs.devexpress.com/WPF/DevExpress.Xpf.WindowsUI.SlideViewItem)
87+
* [ItemHeaderTemplate](https://docs.devexpress.com/WPF/DevExpress.Xpf.WindowsUI.SlideView.ItemHeaderTemplate)
88+
* [ItemContentTemplate](https://docs.devexpress.com/WPF/DevExpress.Xpf.WindowsUI.SlideView.ItemHeaderTemplate)
89+
* [Slide View](https://docs.devexpress.com/WPF/15020/controls-and-libraries/windows-modern-ui/content-containers/slide-view)
1790

18-
<br/>
91+
## More Examples
1992

93+
* [WPF Accordion Control – Bind to Hierarchical Data Structure](https://github.com/DevExpress-Examples/wpf-accordion-bind-to-hierarchical-data-structure)
94+
* [WPF MVVM Framework – Use View Models Generated at Compile Time](https://github.com/DevExpress-Examples/wpf-mvvm-framework-view-model-generator)
95+
* [WPF Dock Layout Manager - Populate a DockLayoutManager LayoutGroup with the ViewModels Collection](https://github.com/DevExpress-Examples/wpf-docklayoutmanager-display-viewmodels-collection-in-layoutgroup)
96+
* [WPF Bars – Create a Container for BarItem Links](https://github.com/DevExpress-Examples/wpf-bars-create-baritem-link-container)
97+
* [WPF PDF Viewer – Customize the Integrated Bar's Commands](https://github.com/DevExpress-Examples/wpf-pdf-viewer-customize-bar-manager)
2098

2199
<!-- feedback -->
22-
## Does this example address your development requirements/objectives?
23-
24-
[<img src="https://www.devexpress.com/support/examples/i/yes-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=create-wpf-slide-view&~~~was_helpful=yes) [<img src="https://www.devexpress.com/support/examples/i/no-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=create-wpf-slide-view&~~~was_helpful=no)
25-
100+
## Does this example address your development requirements/objectives?
101+
102+
[<img src="https://www.devexpress.com/support/examples/i/yes-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=create-wpf-slide-view&~~~was_helpful=yes) [<img src="https://www.devexpress.com/support/examples/i/no-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=create-wpf-slide-view&~~~was_helpful=no)
103+
26104
(you will be redirected to DevExpress.com to submit your response)
27105
<!-- feedback end -->

0 commit comments

Comments
 (0)