O
O
Oleg Pravdin2016-03-11 23:16:01
WPF
Oleg Pravdin, 2016-03-11 23:16:01

How to create a group of elements in a form?

Hello, I need help with the implementation of the code. I need to create a group of elements (let's say two Label and Image) and place copies of this group in the form several times (dynamic number). Questions:
1) I created a class in which I create new elements. How can I display them on the form?
2) How to style them? XAML resource library or via C# code?
3) Whether generally in that direction I dig?
4) Where to read on this topic?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Makarov, 2016-03-12
@opravdin

Read about UserControl in any decent book on WPF, judging by the description of your task, this is exactly what you need.

A
Arseniy Efremov, 2016-03-31
@arusef

Indeed, UserControl is what you need in such a situation. Create a custom control with the necessary content, display its main properties, and place it in your application as if it were a single element.
I can recommend the book "WPF 4 Unleashed", by Adam Nathan , here - chapter 20 (p. 795) about UserControl.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question