My ListView is petty simple:
<ListView ItemsSource="{Binding Path=ActiveCounters}">
<ListView.View>
<GridView>
<GridViewColumn Header="Name" DisplayMemberBinding="{Binding Path=Name}" />
<GridViewColumn Header="Value" DisplayMemberBinding="{Binding Path=Value}" />
<GridViewColumn Header="As Of Date" DisplayMemberBinding="{Binding Path=AsOfDate}" />
<GridViewColumn Header="Duration" DisplayMemberBinding="{Binding Path=Duration}" />
<GridViewColumn Header="Last Modified Date" DisplayMemberBinding="{Binding Path=Timestamp}" />
</GridView>
</ListView.View>
</ListView>
What I want to do is:
- Format "Value" using the built-in format "D0"
- Format "AsOfDate" and "Last Modified Date" using the custom string "MMM d hh:mm:ss tt"
- Format "Duration" with a function defined as "String DurationString(TimeSpan)