vendredi 5 août 2022

System.Windows.Data Error: 25 : ItemTemplate and ItemTemplateSelector are not valid for item Type='CheckBox' in Debug Output

im looking for quite some time through the WWW with out Success

my Debug out get flooded with


    System.Windows.Data Error: 25 : ItemTemplate and ItemTemplateSelector are not valid for item Type='CheckBox'

XAML:

<ScrollViewer CanContentScroll="True" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Disabled">
            <ItemsControl ItemsSource="{Binding WrapPanel}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <CheckBox  IsChecked="{Binding IsChecked}" ToolTip="{Binding ToolTip}" Margin="3,0,0,0">
                            <TextBlock Text="{Binding Content}" TextWrapping="Wrap" Width="250"></TextBlock>
                        </CheckBox>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapPanel Orientation="Vertical" Height="735" Margin="0,10,0,0" ScrollViewer.VerticalScrollBarVisibility="Visible" ItemWidth="290" ItemHeight="20">

                        </WrapPanel>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
            </ItemsControl>
        </ScrollViewer>

THe final results still works like intendet but that extrem Spm in the Debug Outbput is kind of annoying hope you can help




Aucun commentaire:

Enregistrer un commentaire