<UserControl x:Class="DiagnosticExplorer.Silverlight.Controls.TraceScopeViewer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:sysCon="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
xmlns:sysWin="clr-namespace:System.Windows;assembly=System.Windows.Controls"
xmlns:ldsc="clr-namespace:DiagnosticExplorer.Silverlight.Controls"
xmlns:ldsu="clr-namespace:DiagnosticExplorer.Silverlight.Util"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<UserControl.Resources>
<ldsu:StringFormatConverter x:Key="sfc" />
<ldsu:InterestLevelConverter x:Key="interestConverter" LowBrush="Black" MediumBrush="Yellow" HighBrush="Red" UnknownBrush="Purple" />
</UserControl.Resources>
<Grid>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<sysCon:TreeView x:Name="tree" Background="LightSteelBlue" ItemsSource="{Binding TraceItems}">
<sysCon:TreeView.ItemTemplate>
<sysWin:HierarchicalDataTemplate ItemsSource="{Binding Children}">
<StackPanel Orientation="Horizontal" Margin="0,-4,0,-4">
<TextBlock Margin="5,0" VerticalAlignment="Top" Foreground="{Binding InterestLevel, Converter={StaticResource interestConverter}}" Text="{Binding TimeTotal.TotalSeconds, Converter={StaticResource sfc}, ConverterParameter='{0:N3}'}" FontSize="10" />
<TextBlock Margin="5,0" VerticalAlignment="Top" Foreground="{Binding InterestLevel, Converter={StaticResource interestConverter}}" Text="{Binding TimeDelta.TotalSeconds, Converter={StaticResource sfc}, ConverterParameter='{0:N3}'}" FontSize="10" />
<StackPanel Orientation="Vertical">
<TextBlock Margin="5,0" Foreground="{Binding InterestLevel, Converter={StaticResource interestConverter}}" Text="{Binding Text}" FontSize="12" />
<TextBlock Margin="5,0" Foreground="{Binding InterestLevel, Converter={StaticResource interestConverter}}" Text="{Binding Detail}" FontSize="12" />
</StackPanel>
<TextBlock Margin="5,0" VerticalAlignment="Top" Foreground="{Binding InterestLevel, Converter={StaticResource interestConverter}}" Text="{Binding Total.TotalSeconds, Converter={StaticResource sfc}, ConverterParameter='({0:N3})'}" FontSize="10" />
</StackPanel>
</sysWin:HierarchicalDataTemplate>
</sysCon:TreeView.ItemTemplate>
</sysCon:TreeView>
</ScrollViewer>
</Grid>
</UserControl>