A
A
Artem Ivantsov2015-08-19 14:47:16
WPF
Artem Ivantsov, 2015-08-19 14:47:16

How to make a window template in WPF?

In WinForms it was possible to make a window with elements. Then create another window inherited from the first one and add more elements to it. How does WPF do this? Something I can't figure out.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Makarov, 2015-08-19
@Ramirag

How did you try? If you add controls from Code-behind, in theory it should work.

S
Sumor, 2015-08-19
@Sumor

Source window

<Window x:Class="WpfApplication1.MyWindow" ... >

</Window>

Child window :
Create a regular window and bring everything to the form:
Xaml:
<local:MyWindow x:Class="WpfApplication1.MyChildWindow" 
    xmlns:local="clr-namespace:WpfApplication1"
... >

</local:MyWindow>

and at the same time in C#:
class MyChildWindow : MyWindow
{
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question