Datatemplate binding
- by Lasse O
How can i achieve something like this:
<ListView Name="OverviewTitlesListView" ItemsSource="{Binding OverviewTitlesCollection}">
<ListView.View>
<GridView>
<GridViewColumn Header="Index" Width="60" DisplayMemberBinding="{Binding TitleIndex}"/>
<GridViewColumn Header="Start Time" Width="100" DisplayMemberBinding="{Binding StartTime}"/>
<GridViewColumn Header="End Time" Width="100" DisplayMemberBinding="{Binding EndTime}"/>
<GridViewColumn Header="Title Text" Width="550" DisplayMemberBinding="{Binding Text}"/>
<GridViewColumn Header="Approved" Width="80">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Name="Test"/>
<DataTemplate.Triggers>
<Trigger Property="{Binding IsApproved}" Value="true">
<Setter TargetName="Test" Property="Text" Value="Approved"/>
</Trigger>
<Trigger Property="{Binding IsApproved}" Value="false">
<Setter TargetName="Test" Property="Text" Value="Not Approved"/>
</Trigger>
</DataTemplate.Triggers>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
When IsApproved property changes on my object in OverviewTitlesCollection i want to control the text of the TextBlock. How can i control this by triggers in my datatemplate?