I would like to format the string for a TimeSpan object as the following example: 10h 12m 55s
How can I do this?
xaml
<TextBlock Grid.Column="2" Grid.Row="4" FontSize="20" Text="{Binding Path=ElapsedTime}"/>
xaml.cs
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
Streaming StreamingTest = new Streaming();
DataContext = StreamingTest;
}
}
public class Streaming
{
// code
public TimeSpan ElapsedTime
{
get
{
return DateTime.Now - startTime;
}
}
}