User controls provide to build reusable composite UI. They are often used to refactor UI parts into separate components. This video shows how to add custom user controls to the project.
- View Offline
- [Instructor] As you start building your user interface…in your application, it'll get larger over time.…One thing you don't want to do is put all your UI…in a single file this modelithic main window.…You want to split it into parts.…There's a couple of approaches we could take.…One, instead of having these tabs like I have here,…I could have a single UI, the main window.…Then, I could create three separate windows:…a detail window, a weekly calendar window,…and a tour stops window.…Then, I could have some sort of navigation codes…that when you open up the main window and click on a button…or menu item, I would move over to the other windows.…
That works, but it's a bit awkward.…It's also hard to pass state between windows.…In WPF, there's some alternate approaches.…One approach is to to use what's called a page.…The other approach is to use a user control.…They're similar basically because they allow you…to build a composite UI in a page.…Then, you can use a navigation scheme…and something called a frame to move between pages.…
- 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