WPF use a template system to define UI for controls and data. When a custom template is available, WPF replaces the default UI with the templated interface. This tutorial shows how to add a define a template for the ListBox data.
- View Offline
- [Instructor] Another power feature of WPF is a template.…The idea behind a template is that you…define an alternate UI in ZAML.…It's like a subset of ZAML, and then you can…apply that template to other parts of UI.…So there are different kinds of templates in WPF.…There's a control template.…The idea here is that you create a control,…and then when you create the control,…you define what's known as the default template,…and that's what shown in the control.…You can then go and define an alternate template,…this would be a control template,…and then you tell WPF to use your template…not the default template, so every time it renders…that control, it'll use this alternate UI.…
I'll show you how to do this…in the last chapter in this course.…The template I'll look at in this video…is called a data template.…Here I'll be applying the template to a date source.…You remember that my list box is bound to a list of T.…There's one row in the list box…for each row inside my data source.…So now what I'll do is I'll define a data template,…
- Why choose Windows Presentation Foundation?
- Exploring the project types
- Creating a WPF project in Visual Studio
- Exploring assemblies and parts
- Using the XAML editor
- Creating the UI, including tabs, details, and controls
- Using data binding
- Adding styles
- Writing interaction code
- Using control templates, 3D parts, and effects