Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TargetType property not found on DataTemplate

<Grid>
    <ItemsControl ItemsSource="{Binding ScreenViewModelCollection}">
        <ItemsControl.Resources>
            <DataTemplate  x:Key="SomeKey" TargetType="{x:Type  local:RedScreenObject}">
                    <local:RedScreenObject/>
            </DataTemplate>
        </ItemsControl.Resources>
    </ItemsControl>
</Grid>

I have no idea why it can't see the TargetType property. Should be under Resources or ItemTemplate? I tried both it doesn't find it either way.

EDIT: In order to get blasted by more downvotes ha ha it was in reference to this: https://chat.stackoverflow.com/transcript/message/4295316#4295316

like image 384
Lews Therin Avatar asked Feb 19 '23 23:02

Lews Therin


1 Answers

DataTemplate only has a DataType.

like image 184
H.B. Avatar answered Feb 26 '23 17:02

H.B.