BaseOn style inside DataTemplate bugs xaml designer

32 Views Asked by At

Look at screenshot:

There are 2 TextBlock with custom style which is BasedOn on default style.

One inside DataTemplate all time shows error.

Despite the fact what software compiles and run without problem, this is pretty annoying. How can I fix it?


Repro:

<StackPanel>
    <TextBlock>
        <TextBlock.Style>
            <Style TargetType="TextBlock"
                   BasedOn="{StaticResource {x:Type TextBlock}}"></Style>
        </TextBlock.Style></TextBlock>
    <ListBox>
        <ListBox.ItemTemplate>
            <DataTemplate>
                <TextBlock>
                    <TextBlock.Style>
                        <Style TargetType="TextBlock"
                               BasedOn="{StaticResource {x:Type TextBlock}}"></Style>
                    </TextBlock.Style></TextBlock>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
</StackPanel>
0

There are 0 best solutions below