/Release/Silverlight3/Infrastructure/TestFramework/Client/TestExceptionDetails.xaml

# · XAML · 142 lines · 98 code · 20 blank · 24 comment · 0 complexity · a241202c48c8382629aa3bbe18093568 MD5 · raw file

  1. <!--
  2. // (c) Copyright Microsoft Corporation.
  3. // This source is subject to the Microsoft Public License (Ms-PL).
  4. // Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
  5. // All other rights reserved.
  6. -->
  7. <UserControl
  8. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  9. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  10. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  11. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  12. mc:Ignorable="d"
  13. xmlns:local="clr-namespace:Microsoft.Silverlight.Testing.Client"
  14. xmlns:System="clr-namespace:System;assembly=mscorlib"
  15. x:Class="Microsoft.Silverlight.Testing.Client.TestExceptionDetails"
  16. d:DesignHeight="500" d:DesignWidth="460">
  17. <UserControl.Resources>
  18. <ResourceDictionary>
  19. <ResourceDictionary.MergedDictionaries>
  20. <ResourceDictionary Source="/Microsoft.Silverlight.Testing;component/Client/ClientResources.xaml" />
  21. </ResourceDictionary.MergedDictionaries>
  22. <local:ColorSelectorConverter x:Key="expectedExceptionBackgroundColoring" TrueColor="Transparent" FalseColor="{StaticResource highlightBackground}"/>
  23. <local:ColorSelectorConverter x:Key="expectedExceptionBorderColoring" TrueColor="Transparent" FalseColor="{StaticResource highlightBorder}"/>
  24. <local:ColorSelectorConverter x:Key="UnhandledExceptionColor" TrueColor="Black" FalseColor="Red"/>
  25. <DataTemplate x:Key="IssueDataTemplate">
  26. <StackPanel Orientation="Horizontal">
  27. <Ellipse Fill="Gray" Height="5" Width="5" VerticalAlignment="Center" />
  28. <TextBlock Text="{Binding}" Margin="2,0" />
  29. </StackPanel>
  30. </DataTemplate>
  31. </ResourceDictionary>
  32. </UserControl.Resources>
  33. <Grid x:Name="LayoutRoot" Background="White" Margin="0,0,12,0">
  34. <StackPanel>
  35. <StackPanel
  36. Visibility="{Binding KnownBugs, Converter={StaticResource visibilityConverter}}">
  37. <TextBlock Text="Known Issues" FontWeight="Bold" />
  38. <!-- Test passed, known issues caused the failure -->
  39. <TextBlock Text="These issues are marked as known for this test and resulted in it being marked as a success:" Visibility="{Binding Passed, Converter={StaticResource visibilityConverter}}" TextWrapping="Wrap"/>
  40. <!-- Test failed, known issues were not marked as fixed -->
  41. <StackPanel Visibility="{Binding Passed, Converter={StaticResource visibilityConverter}, ConverterParameter=Collapsed}" Orientation="Horizontal">
  42. <Border BorderThickness="1" VerticalAlignment="Center"
  43. BorderBrush="{StaticResource highlightBorderBrush}"
  44. Background="{StaticResource highlightBackgroundBrush}"
  45. Margin="0,-3,-1,-3"
  46. Padding="3"
  47. CornerRadius="3">
  48. <TextBlock Text="These known issues should be marked fixed." VerticalAlignment="Center" />
  49. </Border>
  50. <TextBlock Text=" The test passed otherwise." />
  51. </StackPanel>
  52. <ItemsControl ItemsSource="{Binding KnownBugs}" ItemTemplate="{StaticResource IssueDataTemplate}" />
  53. </StackPanel>
  54. <StackPanel
  55. Visibility="{Binding FixedBugs, Converter={StaticResource visibilityConverter}}">
  56. <TextBlock Text="Fixed Issues" FontWeight="Bold" />
  57. <TextBlock Text="These issues were marked as fixed, but should still be investigated for this failing test:" Visibility="{Binding Passed, Converter={StaticResource visibilityConverter}, ConverterParameter=Collapsed}" TextWrapping="Wrap"/>
  58. <ItemsControl ItemsSource="{Binding FixedBugs}" ItemTemplate="{StaticResource IssueDataTemplate}" />
  59. </StackPanel>
  60. <!-- Any stored exception information -->
  61. <!-- Colors are variable:
  62. - If the test passed, neutral greys or tans
  63. - If it failed, we go red and scary-looking, perhaps a warning icon too
  64. -->
  65. <!-- Shown any expected exception information -->
  66. <StackPanel
  67. Visibility="{Binding SimplifiedExpectedExceptionName, Converter={StaticResource visibilityConverter}}">
  68. <TextBlock Text="Expected Exception (Negative Test)" FontWeight="Bold" />
  69. <StackPanel Visibility="{Binding SimplifiedExpectedExceptionName, Converter={StaticResource visibilityConverter}}" Orientation="Horizontal">
  70. <TextBlock Text="This test expected an exception of type" VerticalAlignment="Center" />
  71. <Border BorderThickness="1" VerticalAlignment="Center"
  72. BorderBrush="{Binding Passed, Converter={StaticResource expectedExceptionBorderColoring}}"
  73. Background="{Binding Passed, Converter={StaticResource expectedExceptionBackgroundColoring}}"
  74. Margin="0,-3,-1,-3"
  75. Padding="3"
  76. CornerRadius="3">
  77. <TextBlock Text="{Binding SimplifiedExpectedExceptionName}" FontWeight="Bold" VerticalAlignment="Center" />
  78. </Border>
  79. </StackPanel>
  80. </StackPanel>
  81. <StackPanel
  82. Visibility="{Binding Result.Exception, Converter={StaticResource visibilityConverter}}">
  83. <TextBlock Text="Exception Details" FontWeight="Bold" />
  84. <Border Background="#05000000" BorderBrush="#7F000000" BorderThickness="1" CornerRadius="4,4,0,0"
  85. Margin="0,8,0,0">
  86. <StackPanel>
  87. <!-- Header -->
  88. <Border CornerRadius="4,4,0,0" BorderThickness="0">
  89. <!--
  90. <Border.Background>
  91. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  92. <GradientStop Color="#FF293955" Offset="0"/>
  93. <GradientStop Color="#FF4A5D80" Offset="1"/>
  94. </LinearGradientBrush>
  95. </Border.Background>
  96. -->
  97. <StackPanel Orientation="Horizontal" Margin="4">
  98. <TextBlock
  99. Text="{Binding SimplifiedExceptionName}"
  100. FontWeight="Bold"
  101. Foreground="{Binding Passed, Converter={StaticResource UnhandledExceptionColor}}"
  102. FontSize="18"/>
  103. <TextBlock
  104. Text=" was unhandled"
  105. Foreground="{Binding Passed, Converter={StaticResource UnhandledExceptionColor}}"
  106. FontSize="18"
  107. />
  108. </StackPanel>
  109. </Border>
  110. <!-- Message -->
  111. <TextBlock Text="{Binding ExceptionMessage}" Margin="4"/>
  112. <TextBox Text="{Binding SimplifiedExceptionStackTrace}" Margin="4" TextWrapping="Wrap"/>
  113. <StackPanel Margin="4" Visibility="{Binding Result.Exception.InnerException, Converter={StaticResource visibilityConverter}}">
  114. <TextBlock Text="This test result also contained an inner exception:" />
  115. <TextBox Text="{Binding Result.Exception.InnerException}" TextWrapping="Wrap" />
  116. </StackPanel>
  117. </StackPanel>
  118. </Border>
  119. </StackPanel>
  120. </StackPanel>
  121. </Grid>
  122. </UserControl>