bind a collection without using list view wpf

Viewed 59

I want to bind a list without listview because I'm tired of the default styles of the listview and that blue selection. The list I'm trying to bind is not a table. It's a question app (s.th like google form). I want to load the questions witch needs binding I don't have enough flexibility. Is there any other way to bind list?

2 Answers

Option1. Apply a custom tyle over your ListView (change the hover like this).

<Style x:Key="GridViewColumnHeaderStyle1" TargetType="{x:Type GridViewColumnHeader}">
    <Style.Triggers>
        <Trigger Property="IsMouseOver" Value="true">
            <Setter Property="Background" Value="Green"/>
        </Trigger>
    </Style.Triggers>
</Style>

and

<ListView VerticalAlignment="Bottom" Height="63" IsSynchronizedWithCurrentItem="True">
    <ListView.View>
        <GridView ColumnHeaderContainerStyle="{StaticResource GridViewColumnHeaderStyle1}" >
            <GridViewColumn/>
        </GridView>
    </ListView.View>
</ListView>

Option2. use <ListBox/> or <ItemsControl/>, they are Base classes that ListView is derived from them and their styles differ from ListView's style so they might be useful for your usecase.

Related