From the course: Developing UWP Apps: 2 Basic Controls and Patterns
Unlock this course with a free trial
Join today to access over 22,400 courses taught by industry experts.
Combining controls - Windows Tutorial
From the course: Developing UWP Apps: 2 Basic Controls and Patterns
Combining controls
- [Narrator] Okay, we're back over in Visual Studio 2017 to take a look at the idea of control patterns and combining controls. Let's go ahead and open our main page back up. And just as an example of combining controls let's take a button. Now remember that we talked about a button having content, not a text property. Let's go ahead an put an image as the button content. So we can go ahead and select an image and we can set the stretch on it to none and run this. Now we have a fully interactive button as content. But we can even go farther than that. We can just continue to nest controls in here as much as we like, we can just create a stack panel and we can put a text block. We throw that image in there. One thing you'll notice is that this content property needs to have a single child. So if this image were outside of the stack panel or if these elements were outside of the stack panel it would not function, it would not compile. So the easy way to do that is to put something that…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.