I
I
iRumba2015-04-24 09:11:48
WPF
iRumba, 2015-04-24 09:11:48

How to add your control to xaml?

I overridden the Page class, called it ConfigPage : Page I
create a WPF Page
For example Page1 : Page
but I want to inherit it from ConfigPage, and the compiler swears at the same time. Accordingly, in xaml, you also need to change the base element from <Page></Page>to <ConfigPage></ConfigPage>, but then the haml constructor swears that it cannot find the ConfigPage type
, here I could do it through interfaces, that is, define the IConfigPage interface and implement it in Page1 : Page, IConfigPage, but there are several such controls (Page1, Page2 ....), and I need to return them in the code, that is, I need a generic data type, which is what ConfigPage is.
Advise what to do.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AxisPod, 2015-04-24
@iRumba

You need a fortune teller. What does the compiler say? To use your types in xaml, you need to add a namespace to xaml. To do this, use the xmlns attribute on the root element, use clr-namespace:<your namespace> as the value.
And then it is already poorly clear what you want.
Questions shouldn't be asked like that. Start with the general (what you do at all) and move deeper if necessary.

V
Vyacheslav Zolotov, 2015-04-24
@SZolotov

Have you declared the namespace with ConfigPage in XAML and code?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question