ListView ignoring DataTemplates when using a ControlTemplate

前端 未结 1 1485
广开言路
广开言路 2021-01-23 06:33

I try to implement a multi column ListView. Everything worked just fine until I tried to style the mouseover- and selection-look of the list view items. I therefore created a Co

相关标签:
1条回答
  • 2021-01-23 06:56

    Replace the ContentPresenter in your ContentTemplate by a GridViewRowPresenter:

    <ControlTemplate TargetType="{x:Type ListViewItem}">
        <Border ...>
            <Border ...>
                <Grid>
                    ...
                    <GridViewRowPresenter ... />
                </Grid>
            </Border>
        </Border>
    </ControlTemplate>
    
    0 讨论(0)
提交回复
热议问题