2

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>
Sinatr
  • 20,892
  • 15
  • 90
  • 319

0 Answers0