view SilverlightGlimpse/SilverlightGlimpse/Views/GlimpseViewer.xaml @ 73:d06c852e0167

looking good!
author Steven Hollidge <stevenhollidge@hotmail.com>
date Mon, 23 Apr 2012 19:15:52 +0100
parents 96e6fbd70f49
children a79e235177f5
line wrap: on
line source

<UserControl x:Class="SilverlightGlimpse.Views.GlimpseViewer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:c="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
             xmlns:local="clr-namespace:SilverlightGlimpse.Converters"
             xmlns:views="clr-namespace:SilverlightGlimpse.Views">
    <UserControl.Resources>
        <SolidColorBrush x:Name="noExceptionsFill" Color="SteelBlue" />
        <SolidColorBrush x:Name="noExceptionsBorder" Color="LightBlue" />
        <SolidColorBrush x:Name="hasExceptionsFill" Color="Red" />
        <SolidColorBrush x:Name="hasExceptionsBorder" Color="Salmon" />
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid x:Name="layoutInstrumentPanel">
            <Grid.Resources>
                <Style TargetType="Ellipse">
                    <Setter Property="Width" Value="40" />
                    <Setter Property="Height" Value="40" />
                    <Setter Property="Fill" Value="{StaticResource noExceptionsFill}" />
                    <Setter Property="Stroke" Value="{StaticResource noExceptionsBorder}" />
                    <Setter Property="StrokeThickness" Value="3" />
                    <Setter Property="Margin" Value="7" />
                </Style>
                <Style TargetType="TextBlock">
                    <Setter Property="HorizontalAlignment" Value="Center" />
                    <Setter Property="VerticalAlignment" Value="Center" />
                    <Setter Property="FontSize" Value="12" />
                    <Setter Property="FontWeight" Value="Bold" />
                    <Setter Property="Foreground" Value="White" />
                    <Setter Property="Text" Value="0" />
                </Style>
            </Grid.Resources>

            <StackPanel Orientation="Horizontal">
                <Grid>
                    <Ellipse x:Name="elpBindingErrors" ToolTipService.ToolTip="Binding Exception Count" />
                    <TextBlock x:Name="tbBindingErrors" />
                </Grid>
                <Grid>
                    <Ellipse x:Name="elpValidationExceptions" ToolTipService.ToolTip="Validation Exception Count" />
                    <TextBlock x:Name="tbValidationExceptions" />
                </Grid>
                <Grid>
                    <Ellipse x:Name="elpUnhandledExceptions" ToolTipService.ToolTip="Unhandled Exception Count" />
                    <TextBlock x:Name="tbUnhandledExceptions" />
                </Grid>
                <Button x:Name="btnExpand"
                        Margin="7"
                        VerticalAlignment="Center"
                        Click="btnExpand_Click"
                        Content="Expand" />
            </StackPanel>
        </Grid>
        <Grid x:Name="layoutViewer" Visibility="Collapsed">
            <Grid.RowDefinitions>
                <RowDefinition Height="auto" />
            </Grid.RowDefinitions>

            <Button x:Name="btnContract"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Top"
                    Click="btnContract_Click"
                    Content="Contract" />

            <c:TabControl Grid.Row="1"
                          Width="600"
                          Height="250">

                <c:TabItem Header="Binding">
                    <views:BindingsViewer />
                </c:TabItem>
                <c:TabItem Header="Debug" Visibility="{Binding IsInDebugMode, Converter={local:BoolToVisibilityConverter FalseValue=Collapsed, TrueValue=Visible}}">
                    <views:LogViewer />
                </c:TabItem>
                <c:TabItem Header="Validation">
                    <views:ValidationsViewer />
                </c:TabItem>
                <c:TabItem Header="Exception">
                    <views:ExceptionsViewer />
                </c:TabItem>
            </c:TabControl>

        </Grid>
    </Grid>

</UserControl>