" /> " /> "/>

Generic.xaml Invalid XAML Error

377 views Asked by At

For example, I have 2 custom control.

A.cs and B.cs

In Generic.xaml

<Style TargetType="{x:Type local:A}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type local:A}">
                <local:B/> <-- Invalid XAML Error
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

And there is no Style of B

B is inherit ContentPresenter

When I build project, I got Invalid XAML Error, but it was builded dll file already.

And if I use it for other project.

It will get StackOverflowException in WindowsBase.dll

0

There are 0 answers