Mercurial > silverbladetech
changeset 71:96e6fbd70f49
Latest version
line wrap: on
line diff
--- a/SilverlightGlimpse/SilverlightGlimpse.Test/MainPage.xaml.cs Mon Apr 23 11:06:29 2012 +0100 +++ b/SilverlightGlimpse/SilverlightGlimpse.Test/MainPage.xaml.cs Mon Apr 23 14:54:24 2012 +0100 @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows;
--- a/SilverlightGlimpse/SilverlightGlimpse.sln Mon Apr 23 11:06:29 2012 +0100 +++ b/SilverlightGlimpse/SilverlightGlimpse.sln Mon Apr 23 14:54:24 2012 +0100 @@ -18,9 +18,11 @@ {BB51026B-2864-4389-AACA-0BBDF1926E46}.Release|Any CPU.ActiveCfg = Release|Any CPU {BB51026B-2864-4389-AACA-0BBDF1926E46}.Release|Any CPU.Build.0 = Release|Any CPU {212DBD25-6C98-45EB-9974-51D04D8B6549}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {212DBD25-6C98-45EB-9974-51D04D8B6549}.Debug|Any CPU.Build.0 = Debug|Any CPU {212DBD25-6C98-45EB-9974-51D04D8B6549}.Release|Any CPU.ActiveCfg = Release|Any CPU {212DBD25-6C98-45EB-9974-51D04D8B6549}.Release|Any CPU.Build.0 = Release|Any CPU {0C1CC1FC-915A-4428-8952-CDC79EABC3F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0C1CC1FC-915A-4428-8952-CDC79EABC3F4}.Debug|Any CPU.Build.0 = Debug|Any CPU {0C1CC1FC-915A-4428-8952-CDC79EABC3F4}.Release|Any CPU.ActiveCfg = Release|Any CPU {0C1CC1FC-915A-4428-8952-CDC79EABC3F4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection
--- a/SilverlightGlimpse/SilverlightGlimpse/Controls/BrokenBindingsViewer.xaml Mon Apr 23 11:06:29 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -<UserControl x:Class="SilverlightGlimpse.Controls.BrokenBindingsViewer" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - Loaded="BrokenBindings_Loaded"> - - <Grid x:Name="LayoutRoot" Background="White"> - - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="*" /> - </Grid.RowDefinitions> - - <StackPanel Grid.Row="0" Orientation="Horizontal"> - <TextBlock Width="145" - Margin="7,0,0,0" - Text="Control Name" /> - <TextBlock Width="120" Text="Type" /> - <TextBlock Width="120" Text="Property" /> - <TextBlock Width="150" Text="Path" /> - <TextBlock Width="50" Text="Quantity" /> - </StackPanel> - - <ScrollViewer Grid.Row="1"> - <ListBox x:Name="lbBindings"> - <ListBox.ItemTemplate> - <DataTemplate> - <StackPanel Orientation="Horizontal" ToolTipService.ToolTip="{Binding ToStringProperty}"> - <TextBlock Width="145" Text="{Binding ControlName}" /> - <TextBlock Width="120" Text="{Binding ControlTypeName}" /> - <TextBlock Width="120" Text="{Binding PropertyName}" /> - <TextBlock Width="150" Text="{Binding Path}" /> - <TextBlock Width="50" Text="{Binding Quantity}" /> - </StackPanel> - </DataTemplate> - </ListBox.ItemTemplate> - </ListBox> - </ScrollViewer> - </Grid> -</UserControl>
--- a/SilverlightGlimpse/SilverlightGlimpse/Controls/BrokenBindingsViewer.xaml.cs Mon Apr 23 11:06:29 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -using System.Diagnostics; -using System.Reflection; -using System.Windows; -using System.Windows.Media; -using SilverlightGlimpse.Models; -using SilverlightGlimpse.Services; - -namespace SilverlightGlimpse.Controls -{ - public partial class BrokenBindingsViewer - { - public BrokenBindingsViewer() - { - InitializeComponent(); - } - - private void BrokenBindings_Loaded(object sender, RoutedEventArgs e) - { - lbBindings.Items.Clear(); - LoadBrokenBindings(Glimpse.Service.RootVisual); - } - - private void LoadBrokenBindings(UIElement uiElement) - { - var frameworkElement = uiElement as FrameworkElement; - if (frameworkElement == null) return; - - foreach (var fieldInfo in frameworkElement.GetType().GetFields(BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Instance | BindingFlags.Static)) - { - if (!ReferenceEquals(fieldInfo.FieldType, typeof (DependencyProperty))) continue; - - var bindingExpression = frameworkElement.GetBindingExpression((DependencyProperty)fieldInfo.GetValue(null)); - - if (bindingExpression == null || bindingExpression.ParentBinding.Source != null || - bindingExpression.ParentBinding.RelativeSource != null) continue; - - var isInherited = false; - - if (frameworkElement.DataContext != null && !string.IsNullOrEmpty(bindingExpression.ParentBinding.Path.Path)) - { - foreach (var propertyInfo in frameworkElement.DataContext.GetType().GetProperties(BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Static | BindingFlags.Instance)) - { - if (string.Compare(propertyInfo.Name, bindingExpression.ParentBinding.Path.Path) == 0) - { - isInherited = true; - break; - } - } - } - - if (isInherited) - { - break; - } - - //this code handles empty bindings on the Button controls - //I'll have to look into why the Button has an empty or unresolved binding - if (string.IsNullOrEmpty(frameworkElement.Name) - && frameworkElement.GetType().Name == "TextBlock" - && fieldInfo.Name == "TextProperty" - && string.IsNullOrEmpty(bindingExpression.ParentBinding.Path.Path)) - { - break; - } - - var brokenBinding = new BrokenBinding( - frameworkElement.Name, - frameworkElement.GetType().Name, - fieldInfo.Name, - bindingExpression.ParentBinding.Path.Path); - - lbBindings.Items.Add(brokenBinding); - Debug.WriteLine("Broken Binding: {0}", brokenBinding); - } - - int children = VisualTreeHelper.GetChildrenCount(frameworkElement); - - for (int j = 0; j <= children - 1; j++) - { - var child = VisualTreeHelper.GetChild(frameworkElement, j) as FrameworkElement; - - if (child != null) - { - LoadBrokenBindings(child); - } - } - } - } -} \ No newline at end of file
--- a/SilverlightGlimpse/SilverlightGlimpse/Controls/ExceptionsViewer.xaml Mon Apr 23 11:06:29 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -<UserControl x:Class="SilverlightGlimpse.Controls.ExceptionsViewer" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - Loaded="ExceptionsViewer_Loaded"> - <Grid x:Name="LayoutRoot"> - - <Grid.ColumnDefinitions> - <ColumnDefinition Width="225" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="*" /> - </Grid.RowDefinitions> - - <Grid Grid.Row="1"> - <Grid.RowDefinitions> - <RowDefinition Height="*" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - - <ListBox x:Name="lbExceptions" - Margin="3.5" - ItemsSource="{Binding}" - SelectionChanged="lbExceptions_SelectionChanged" /> - - <Button Grid.Row="1" - Width="135" - Margin="7" - HorizontalAlignment="Center" - VerticalAlignment="Center" - Click="ClearExceptions_Click" - Content="Clear Exceptions" /> - </Grid> - <ScrollViewer Grid.Row="1" - Grid.Column="1" - Margin="3.5" - DataContext="{Binding ElementName=lbExceptions, - Path=SelectedItem}"> - <Grid x:Name="gridExceptionDetail"> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - - <!-- - <TextBlock x:Name="tbAction" - Text="Action" - TextDecorations="Underline" - Visibility="Collapsed" /> - - <TextBlock Grid.Row="1" - FontSize="11" - Text="{Binding Path=Action}" - TextWrapping="Wrap" - Visibility="{Binding ElementName=tbAction, - Path=Visibility}" /> - - <TextBlock Grid.Row="2" - Margin="0,7,0,0" - Text="Control Name" - TextDecorations="Underline" - Visibility="{Binding ElementName=tbAction, - Path=Visibility}" /> - <TextBlock Grid.Row="3" - FontSize="11" - Text="{Binding Path=ControlName}" - TextWrapping="Wrap" - Visibility="{Binding ElementName=tbAction, - Path=Visibility}" /> - --> - - <TextBlock Grid.Row="0" - Margin="0,7,0,0" - Text="Message" - TextDecorations="Underline" /> - - <TextBlock Grid.Row="1" - FontSize="11" - Text="{Binding Path=Message}" - TextWrapping="Wrap" /> - - <TextBlock Grid.Row="2" - Margin="0,7,0,0" - Text="Stack Trace" - TextDecorations="Underline" /> - <TextBlock Grid.Row="3" - FontSize="11" - Text="{Binding Path=StackTrace}" - TextWrapping="Wrap" /> - - </Grid> - </ScrollViewer> - </Grid> -</UserControl>
--- a/SilverlightGlimpse/SilverlightGlimpse/Controls/ExceptionsViewer.xaml.cs Mon Apr 23 11:06:29 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using SilverlightGlimpse.Models; -using SilverlightGlimpse.Services; - -namespace SilverlightGlimpse.Controls -{ - public partial class ExceptionsViewer - { - public ExceptionsViewer() - { - InitializeComponent(); - } - - private void ClearExceptions_Click(object sender, RoutedEventArgs e) - { - Glimpse.Service.Exceptions.Clear(); - } - - private void ExceptionsViewer_Loaded(object sender, RoutedEventArgs e) - { - DataContext = Glimpse.Service.Exceptions; - if (Glimpse.Service.Exceptions.Count > 0) - lbExceptions.SelectedIndex = 0; - } - - private void lbExceptions_SelectionChanged(object sender, SelectionChangedEventArgs e) - { - gridExceptionDetail.Visibility = lbExceptions.SelectedItem == null - ? Visibility.Collapsed - : Visibility.Visible; - } - } -} \ No newline at end of file
--- a/SilverlightGlimpse/SilverlightGlimpse/Controls/FloatableWindow/FloatableWindow.cs Mon Apr 23 11:06:29 2012 +0100 +++ b/SilverlightGlimpse/SilverlightGlimpse/Controls/FloatableWindow/FloatableWindow.cs Mon Apr 23 14:54:24 2012 +0100 @@ -302,11 +302,6 @@ private double _horizontalOffset; /// <summary> - /// Private accessor for the Resizer. - /// </summary> - private FrameworkElement _resizer; - - /// <summary> /// Private accessor for the IsModal /// </summary> [DefaultValue(false)] @@ -1561,48 +1556,6 @@ } } - private void Resizer_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) - { - this._resizer.CaptureMouse(); - this._isMouseCaptured = true; - this._clickPoint = e.GetPosition(sender as UIElement); - -#if DEBUG - this.Title = string.Format("X:{0},Y:{1}", this._clickPoint.X.ToString(), this._clickPoint.Y.ToString()); -#endif - } - - private void Resizer_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) - { - this._resizer.ReleaseMouseCapture(); - this._isMouseCaptured = false; - this._resizer.Opacity = 0.25; - } - - private void Resizer_MouseMove(object sender, System.Windows.Input.MouseEventArgs e) - { - if (this._isMouseCaptured && this.ContentRoot != null) - { - // If the child window is dragged out of the page, return - if (Application.Current != null && Application.Current.RootVisual != null && - (e.GetPosition(Application.Current.RootVisual).X < 0 || e.GetPosition(Application.Current.RootVisual).Y < 0)) - { - return; - } - -#if DEBUG - this.Title = string.Format("X:{0},Y:{1}", this._clickPoint.X.ToString(), this._clickPoint.Y.ToString()); -#endif - - Point p = e.GetPosition(this.ContentRoot); - - if ((p.X > this._clickPoint.X) && (p.Y > this._clickPoint.Y)) - { - this.Width = (double)(p.X - (12 - this._clickPoint.X)); - this.Height = (double)(p.Y - (12 - this._clickPoint.Y)); - } - } - } private Storyboard GetVisualStateStoryboard(string visualStateGroupName, string visualStateName) {
--- a/SilverlightGlimpse/SilverlightGlimpse/Controls/GlimpseViewer.xaml Mon Apr 23 11:06:29 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -<UserControl x:Class="SilverlightGlimpse.Controls.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:localc="clr-namespace:SilverlightGlimpse.Controls"> - <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> - <local:BoolToVisibilityConverter x:Key="InverseVisibility" - FalseValue="Visible" - TrueValue="Collapsed" /> - <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="800" - Height="450"> - - <c:TabItem Header="Bindings"> - <localc:BrokenBindingsViewer /> - </c:TabItem> - <c:TabItem Header="Validation"> - <localc:ExceptionsViewer /> - </c:TabItem> - <c:TabItem Header="Exceptions"> - <localc:ExceptionsViewer /> - </c:TabItem> - <c:TabItem Header="Debug Info" Visibility="{Binding IsInDebugMode, Converter={StaticResource InverseVisibility}}"> - <localc:ExceptionsViewer /> - </c:TabItem> - - </c:TabControl> - - </Grid> - </Grid> - -</UserControl>
--- a/SilverlightGlimpse/SilverlightGlimpse/Controls/GlimpseViewer.xaml.cs Mon Apr 23 11:06:29 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -using System.Collections.Specialized; -using System.Windows; -using SilverlightGlimpse.Models; -using SilverlightGlimpse.Services; - -namespace SilverlightGlimpse.Controls -{ - public partial class GlimpseViewer - { - public GlimpseViewer() - { - InitializeComponent(); - DataContext = Glimpse.Service; - Glimpse.Service.Exceptions.CollectionChanged += HostExceptions_CollectionChanged; - } - - private void btnContract_Click(object sender, RoutedEventArgs e) - { - layoutViewer.Visibility = Visibility.Collapsed; - } - - private void btnExpand_Click(object sender, RoutedEventArgs e) - { - layoutViewer.Visibility = Visibility.Visible; - } - - // TODO: Sort this mess out :) - private void HostExceptions_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) - { - int unhandledExceptionCount = 0; - int validationExceptionCount = 0; - - //foreach (var ex in Glimpse.Service.Exceptions) - //{ - // if (ex.IsValidationException) - // validationExceptionCount++; - // else - // unhandledExceptionCount++; - //} - - //tbValidationExceptions.Text = validationExceptionCount.ToString(); - - //if (validationExceptionCount == 0) - //{ - // elpValidationExceptions.Fill = noExceptionsFill; - // elpValidationExceptions.Stroke = noExceptionsBorder; - //} - - //tbUnhandledExceptions.Text = unhandledExceptionCount.ToString(); - - //elpUnhandledExceptions.Fill = unhandledExceptionCount == 0 - // ? noExceptionsBrush - // : hasExceptionsBrush; - } - } -} \ No newline at end of file
--- a/SilverlightGlimpse/SilverlightGlimpse/Controls/LoadExceptionViewer.xaml Mon Apr 23 11:06:29 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -<UserControl x:Class="SilverlightGlimpse.Controls.LoadExceptionViewer" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> - <Border Width="700" - Height="375" - Margin="11" - BorderBrush="SteelBlue" - BorderThickness="6" - CornerRadius="5"> - <Grid x:Name="LayoutRoot"> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="100" /> - <RowDefinition Height="*" /> - </Grid.RowDefinitions> - - <Rectangle Fill="SteelBlue" /> - - <TextBlock x:Name="txtTitle" - Margin="3.5" - VerticalAlignment="Center" - Foreground="White" - Text="Exception source goes here from code behind" /> - - <ListBox x:Name="lbExceptions" - Grid.Row="1" - Margin="3.5" - DisplayMemberPath="Message" /> - - <ScrollViewer Grid.Row="2" - Margin="3.5" - Background="White" - DataContext="{Binding ElementName=lbExceptions, - Path=SelectedItem}"> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - - <TextBlock Text="Message" TextDecorations="Underline" /> - <TextBlock Grid.Row="1" - Text="{Binding Path=Message}" - TextWrapping="Wrap" /> - - <TextBlock Grid.Row="2" - Margin="0,11,0,0" - Text="Stack Trace" - TextDecorations="Underline" /> - <TextBlock Grid.Row="3" - FontSize="11" - Text="{Binding Path=StackTrace}" - TextWrapping="Wrap" /> - </Grid> - </ScrollViewer> - </Grid> - </Border> - -</UserControl> -
--- a/SilverlightGlimpse/SilverlightGlimpse/Controls/LoadExceptionViewer.xaml.cs Mon Apr 23 11:06:29 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -using System; - -namespace SilverlightGlimpse.Controls -{ - public partial class LoadExceptionViewer - { - public LoadExceptionViewer() - { - InitializeComponent(); - } - - public LoadExceptionViewer(Exception e, string sourceLocation) : this() - { - txtTitle.Text = string.Concat("Exception ", sourceLocation.TrimStart()); - - var ex = e; - - while (ex != null) - { - lbExceptions.Items.Add(ex); - ex = ex.InnerException; - } - - if (lbExceptions.Items.Count > 0) - { - lbExceptions.SelectedIndex = 0; - } - } - } -} \ No newline at end of file
--- a/SilverlightGlimpse/SilverlightGlimpse/Converters/BoolToValueConverter.cs Mon Apr 23 11:06:29 2012 +0100 +++ b/SilverlightGlimpse/SilverlightGlimpse/Converters/BoolToValueConverter.cs Mon Apr 23 14:54:24 2012 +0100 @@ -3,25 +3,29 @@ using System; using System.Globalization; using System.Windows.Data; +using System.Windows.Markup; namespace SilverlightGlimpse.Converters { - public class BoolToValueConverter<T> : IValueConverter + public class BoolToValueConverter<T> : MarkupExtension, IValueConverter { public T FalseValue { get; set; } public T TrueValue { get; set; } public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - if (value == null) - return FalseValue; - else - return (bool)value ? TrueValue : FalseValue; + if (value == null) return FalseValue; + return (bool)value ? TrueValue : FalseValue; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return value != null && value.Equals(TrueValue); } + + public override object ProvideValue(IServiceProvider serviceProvider) + { + return this; + } } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightGlimpse/SilverlightGlimpse/Models/BindingError.cs Mon Apr 23 14:54:24 2012 +0100 @@ -0,0 +1,47 @@ +namespace SilverlightGlimpse.Models +{ + public class BindingError + { + #region Fields + + private readonly string _controlName = string.Empty; + + #endregion + + #region Constructor + + public BindingError(string controlName, string controlTypeName, string propertyName, string path) + { + _controlName = controlName; + ControlTypeName = controlTypeName; + PropertyName = propertyName; + Path = path; + } + + #endregion + + #region Properties + + public string ControlName { get { return string.IsNullOrEmpty(_controlName) ? "(none)" : _controlName; } } + public string ControlTypeName { get; private set; } + public string Path { get; private set; } + public string PropertyName { get; private set; } + public string ToStringProperty { get { return ToString(); } } + + #endregion + + #region Methods + + public override string ToString() + { + return string.Format( + "Control Name: {0}, Type: {1}, Property: {2}, Path: {3}", + ControlName, + ControlTypeName, + PropertyName, + Path); + } + + #endregion + } +} \ No newline at end of file
--- a/SilverlightGlimpse/SilverlightGlimpse/Models/BrokenBinding.cs Mon Apr 23 11:06:29 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -namespace SilverlightGlimpse.Models -{ - public class BrokenBinding - { - #region Fields - - private readonly string _controlName = string.Empty; - - #endregion - - #region Constructor - - public BrokenBinding(string controlName, string controlTypeName, string propertyName, string path) - { - _controlName = controlName; - ControlTypeName = controlTypeName; - PropertyName = propertyName; - Path = path; - } - - #endregion - - #region Properties - - public string ControlName { get { return string.IsNullOrEmpty(_controlName) ? "(none)" : _controlName; } } - public string ControlTypeName { get; private set; } - public string Path { get; private set; } - public string PropertyName { get; private set; } - public string ToStringProperty { get { return ToString(); } } - - #endregion - - #region Methods - - public override string ToString() - { - return string.Format( - "Control Name: {0}, Type: {1}, Property: {2}, Path: {3}", - ControlName, - ControlTypeName, - PropertyName, - Path); - } - - #endregion - } -} \ No newline at end of file
--- a/SilverlightGlimpse/SilverlightGlimpse/Models/ObservableQueue.cs Mon Apr 23 11:06:29 2012 +0100 +++ b/SilverlightGlimpse/SilverlightGlimpse/Models/ObservableQueue.cs Mon Apr 23 14:54:24 2012 +0100 @@ -15,15 +15,15 @@ /// <typeparam name="T">Specifies the type of elements in the queue.</typeparam> /// <filterpriority>1</filterpriority> [DebuggerTypeProxy(typeof(System_QueueDebugView<>)), ComVisible(false), DebuggerDisplay("Count = {Count}")] - public class ObservableQueue<T> : IEnumerable<T>, ICollection, INotifyCollectionChanged, INotifyPropertyChanged where T : class + public class ObservableQueue<T> : IEnumerable<T>, ICollection, INotifyCollectionChanged, INotifyPropertyChanged { /// <summary>Enumerates the elements of a ObservableQueue.</summary> public struct Enumerator : IEnumerator<T> { - private ObservableQueue<T> _q; + private readonly ObservableQueue<T> _queue; private int _index; - private int _version; + private readonly int _version; private T _currentElement; /// <summary>Gets the element at the current position of the enumerator.</summary> /// <returns>The element in the ObservableQueue at the current position of the enumerator.</returns> @@ -35,10 +35,7 @@ { if (this._index < 0) { - if (this._index == -1) - { - throw new InvalidOperationException("Enumerator not started"); - } + if (this._index == -1) throw new InvalidOperationException("Enumerator not started"); throw new InvalidOperationException("Enumeration ended"); } return this._currentElement; @@ -50,20 +47,16 @@ { if (this._index < 0) { - if (this._index == -1) - { - throw new InvalidOperationException("Enumerator not started"); - } - + if (this._index == -1) throw new InvalidOperationException("Enumerator not started"); throw new InvalidOperationException("Enumeration ended"); } return this._currentElement; } } - internal Enumerator(ObservableQueue<T> q) + internal Enumerator(ObservableQueue<T> queue) { - this._q = q; - this._version = this._q._version; + this._queue = queue; + this._version = this._queue._version; this._index = -1; this._currentElement = default(T); } @@ -78,27 +71,29 @@ /// <exception cref="T:System.InvalidOperationException">The collection was modified after the enumerator was created. </exception> public bool MoveNext() { - if (this._version != this._q._version) throw new InvalidOperationException("Enumerator version mismatch"); + if (this._version != this._queue._version) throw new InvalidOperationException("Enumerator version mismatch"); if (this._index == -2) return false; this._index++; - if (this._index == this._q._size) + if (this._index == this._queue._size) { this._index = -2; this._currentElement = default(T); return false; } - this._currentElement = this._q.GetElement(this._index); + this._currentElement = this._queue.GetElement(this._index); return true; } void IEnumerator.Reset() { - if (this._version != this._q._version) throw new InvalidOperationException("Enumerator version mismatch"); + if (this._version != this._queue._version) throw new InvalidOperationException("Enumerator version mismatch"); this._index = -1; this._currentElement = default(T); } } + + //TODO: refactor these: in or out? private const int _MinimumGrow = 4; private const int _ShrinkThreshold = 32; private const int _GrowFactor = 200; @@ -110,11 +105,9 @@ get { return _arrayBackupField; } set { - if (_arrayBackupField != value) - { - _arrayBackupField = value; - RaiseCollectionChanged(NotifyCollectionChangedAction.Reset); - } + if (_arrayBackupField == value) return; + _arrayBackupField = value; + RaiseCollectionChanged(NotifyCollectionChangedAction.Reset); } } @@ -322,7 +315,6 @@ public T Peek() { if (this._size == 0) throw new InvalidOperationException("Cannot peek at en empty queue!"); - return this._array[this._head]; } /// <summary>Determines whether an element is in the ObservableQueue.</summary> @@ -411,7 +403,11 @@ public event NotifyCollectionChangedEventHandler CollectionChanged = delegate { }; private void RaiseCollectionChanged(NotifyCollectionChangedAction action) { - CollectionChanged(this, new NotifyCollectionChangedEventArgs(action)); + var e = (action == NotifyCollectionChangedAction.Reset) + ? new NotifyCollectionChangedEventArgs(action) + : new NotifyCollectionChangedEventArgs(action, null, 0); + + CollectionChanged(this, e); } public event PropertyChangedEventHandler PropertyChanged = delegate { }; @@ -423,19 +419,14 @@ internal sealed class System_QueueDebugView<T> { - private ObservableQueue<T> queue; + private readonly ObservableQueue<T> _queue; [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] - public T[] Items - { - get - { - return this.queue.ToArray(); - } - } + public T[] Items { get { return this._queue.ToArray(); } } + public System_QueueDebugView(ObservableQueue<T> queue) { if (queue == null) throw new ArgumentNullException("queue"); - this.queue = queue; + this._queue = queue; } } } \ No newline at end of file
--- a/SilverlightGlimpse/SilverlightGlimpse/Services/Glimpse.cs Mon Apr 23 11:06:29 2012 +0100 +++ b/SilverlightGlimpse/SilverlightGlimpse/Services/Glimpse.cs Mon Apr 23 14:54:24 2012 +0100 @@ -5,7 +5,7 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Threading; -using SilverlightGlimpse.Controls; +using SilverlightGlimpse.Views; using SilverlightGlimpse.Models; using System.Windows.Media; @@ -17,8 +17,8 @@ private static Glimpse _instance; private DispatcherTimer _refreshBindingCountTimer; - private static readonly TimeSpan _fiveSeconds = new TimeSpan(0, 0, 0, 5); - Queue<string> _log = new Queue<string>(); + private static readonly TimeSpan FiveSeconds = new TimeSpan(0, 0, 0, 5); + private const int MAX_LOG_ITEMS = 100; #endregion @@ -26,84 +26,47 @@ private Glimpse() { - BrokenBindings = new ObservableCollection<BrokenBinding>(); + BindingErrors = new ObservableCollection<BindingError>(); ValidationErrors = new ObservableCollection<ValidationWrapper>(); Exceptions = new ObservableCollection<Exception>(); - - InitialiseDebugMonitor(); - } - - private static void InitialiseDebugMonitor() - { - DebugMonitor.OnOutputDebugString += DebugMonitor_OnOutputDebugString; - try - { - DebugMonitor.Start(); - } - catch (Exception ex) - { - Debug.WriteLine(ex.Message, "Failed to start DebugMonitor"); - return; - } - - if (Debugger.IsAttached) - { - AppendText(-1, "You are currently debugging DbMon.NET so you won't get any 'Debug.WriteLine's from it."); - } - else - { - Debug.WriteLine("DbMon.NET loaded."); - } + Log = new ObservableQueue<string>(); } #endregion #region Properties - public static Glimpse Service - { - get { return _instance ?? (_instance = new Glimpse()); } - } - + public static Glimpse Service { get { return _instance ?? (_instance = new Glimpse()); } } internal Application App { get; private set; } internal FloatableWindow GlimpseWindow { get; set;} internal string Title { get; set; } - internal ObservableCollection<BrokenBinding> BrokenBindings { get; private set; } + internal ObservableCollection<BindingError> BindingErrors { get; private set; } internal ObservableCollection<ValidationWrapper> ValidationErrors { get; private set; } internal ObservableCollection<Exception> Exceptions { get; private set; } internal FrameworkElement RootVisual { get; private set; } internal TimeSpan BindingsRefreshRate { get; private set; } - internal bool IsInDebugMode + internal ObservableQueue<string> Log { get; private set; } + public bool IsInDebugMode { get { #if DEBUG return true; #endif +#pragma warning disable 162 return false; +#pragma warning restore 162 } } - - - public void WriteLog(string value) - { - _items.Enqueue(value); - if (_items.Count > 100) - _items.Dequeue(); - } #endregion - private static void DebugMonitor_OnOutputDebugString(int pid, string text) + private void WriteToLog(string text, params object[] args) { - AppendText(pid, text); + Log.Enqueue(string.Format(text, args)); + if (Log.Count > MAX_LOG_ITEMS) Log.Dequeue(); } - private static void AppendText(int pid, string text) - { - //DateTime.Now.ToString("HH:mm:ss") - } - - #region Creation and Loading + #region UI Creation and Loading public void DisplayLoadFailure(Application app, Exception ex, string title) { @@ -121,10 +84,12 @@ RootVisual = App.RootVisual as FrameworkElement; if (RootVisual == null) throw new NullReferenceException("The Application provided did not have a valid RootVisual object"); Title = title; - BindingsRefreshRate = (bindingsRefreshRate == default(TimeSpan)) ? _fiveSeconds : bindingsRefreshRate; + BindingsRefreshRate = (bindingsRefreshRate == default(TimeSpan)) ? FiveSeconds : bindingsRefreshRate; RootVisual.BindingValidationError += HostRootVisual_BindingValidationError; App.UnhandledException += Application_UnhandledException; + + _refreshBindingCountTimer = new DispatcherTimer(); _refreshBindingCountTimer.Tick += RefreshBindingCountTimer_Tick; _refreshBindingCountTimer.Interval = BindingsRefreshRate; @@ -156,81 +121,77 @@ #endregion - //#region Update broken bindings list + #region Update broken bindings collection - //private void LoadBrokenBindings(UIElement uiElement) - //{ - // var frameworkElement = uiElement as FrameworkElement; - // if (frameworkElement == null) return; - - // foreach (var fieldInfo in frameworkElement.GetType().GetFields(BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Instance | BindingFlags.Static)) - // { - // if (!ReferenceEquals(fieldInfo.FieldType, typeof(DependencyProperty))) continue; - - // var bindingExpression = frameworkElement.GetBindingExpression((DependencyProperty)fieldInfo.GetValue(null)); + private void LoadBrokenBindings(UIElement uiElement) + { + var frameworkElement = uiElement as FrameworkElement; + if (frameworkElement == null) return; - // if (bindingExpression == null || bindingExpression.ParentBinding.Source != null || - // bindingExpression.ParentBinding.RelativeSource != null) continue; - - // var isInherited = false; + foreach (var fieldInfo in frameworkElement.GetType().GetFields(BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Instance | BindingFlags.Static)) + { + if (!ReferenceEquals(fieldInfo.FieldType, typeof(DependencyProperty))) continue; - // if (frameworkElement.DataContext != null && !string.IsNullOrEmpty(bindingExpression.ParentBinding.Path.Path)) - // { - // foreach (var propertyInfo in frameworkElement.DataContext.GetType().GetProperties(BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Static | BindingFlags.Instance)) - // { - // if (string.Compare(propertyInfo.Name, bindingExpression.ParentBinding.Path.Path) == 0) - // { - // isInherited = true; - // break; - // } - // } - // } + var bindingExpression = frameworkElement.GetBindingExpression((DependencyProperty)fieldInfo.GetValue(null)); + + if (bindingExpression == null || bindingExpression.ParentBinding.Source != null || + bindingExpression.ParentBinding.RelativeSource != null) continue; + + var isInherited = false; - // if (isInherited) - // { - // break; - // } + if (frameworkElement.DataContext != null && !string.IsNullOrEmpty(bindingExpression.ParentBinding.Path.Path)) + { + foreach (var propertyInfo in frameworkElement.DataContext.GetType().GetProperties(BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.Static | BindingFlags.Instance)) + { + if (String.CompareOrdinal(propertyInfo.Name, bindingExpression.ParentBinding.Path.Path) != 0) continue; + isInherited = true; + break; + } + } - // //this code handles empty bindings on the Button controls - // //I'll have to look into why the Button has an empty or unresolved binding - // if (string.IsNullOrEmpty(frameworkElement.Name) - // && frameworkElement.GetType().Name == "TextBlock" - // && fieldInfo.Name == "TextProperty" - // && string.IsNullOrEmpty(bindingExpression.ParentBinding.Path.Path)) - // { - // break; - // } + if (isInherited) break; + + var brokenBinding = new BindingError( + frameworkElement.Name, + frameworkElement.GetType().Name, + fieldInfo.Name, + bindingExpression.ParentBinding.Path.Path); - // var brokenBinding = new BrokenBinding( - // frameworkElement.Name, - // frameworkElement.GetType().Name, - // fieldInfo.Name, - // bindingExpression.ParentBinding.Path.Path); + BindingErrors.Add(brokenBinding); + Debug.WriteLine("Broken Binding: {0}", brokenBinding); + } - // //TODO: lbBindings.Items.Add(brokenBinding); - // Debug.WriteLine("Broken Binding: {0}", brokenBinding); - // } - - // int children = VisualTreeHelper.GetChildrenCount(frameworkElement); + int children = VisualTreeHelper.GetChildrenCount(frameworkElement); - // for (int j = 0; j <= children - 1; j++) - // { - // var child = VisualTreeHelper.GetChild(frameworkElement, j) as FrameworkElement; + for (int j = 0; j <= children - 1; j++) + { + var child = VisualTreeHelper.GetChild(frameworkElement, j) as FrameworkElement; - // if (child != null) - // { - // LoadBrokenBindings(child); - // } - // } - //} - //#endregion + if (child != null) + { + LoadBrokenBindings(child); + } + } + } + + #endregion #region Events handlers // Bindings private void RefreshBindingCountTimer_Tick(object sender, EventArgs e) { + var stopwatch = Stopwatch.StartNew(); + + _refreshBindingCountTimer.Stop(); + + BindingErrors.Clear(); LoadBrokenBindings(RootVisual); + + stopwatch.Stop(); + WriteToLog("Refreshing the binding error count took {0} {1}", stopwatch.ElapsedTime.Milliseconds, "ms"); + + _refreshBindingCountTimer.Start(); } // Validation
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightGlimpse/SilverlightGlimpse/Services/Stopwatch.cs Mon Apr 23 14:54:24 2012 +0100 @@ -0,0 +1,29 @@ +using System; + +namespace SilverlightGlimpse.Services +{ + public class Stopwatch + { + private long _start; + private long _end; + + public void Start() + { + _start = DateTime.Now.Ticks; + } + + public void Stop() + { + _end = DateTime.Now.Ticks; + } + + public TimeSpan ElapsedTime { get { return new TimeSpan(_end - _start); }} + + public static Stopwatch StartNew() + { + var stopwatch = new Stopwatch(); + stopwatch.Start(); + return stopwatch; + } + } +} \ No newline at end of file
--- a/SilverlightGlimpse/SilverlightGlimpse/SilverlightGlimpse.csproj Mon Apr 23 11:06:29 2012 +0100 +++ b/SilverlightGlimpse/SilverlightGlimpse/SilverlightGlimpse.csproj Mon Apr 23 14:54:24 2012 +0100 @@ -70,43 +70,50 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> - <Compile Include="Controls\BrokenBindingsViewer.xaml.cs"> - <DependentUpon>BrokenBindingsViewer.xaml</DependentUpon> + <Compile Include="Views\BindingsViewer.xaml.cs"> + <DependentUpon>BindingsViewer.xaml</DependentUpon> </Compile> - <Compile Include="Controls\GlimpseViewer.xaml.cs"> + <Compile Include="Views\GlimpseViewer.xaml.cs"> <DependentUpon>GlimpseViewer.xaml</DependentUpon> </Compile> - <Compile Include="Controls\LoadExceptionViewer.xaml.cs"> + <Compile Include="Views\LoadExceptionViewer.xaml.cs"> <DependentUpon>LoadExceptionViewer.xaml</DependentUpon> </Compile> - <Compile Include="Controls\ExceptionsViewer.xaml.cs"> + <Compile Include="Views\ExceptionsViewer.xaml.cs"> <DependentUpon>ExceptionsViewer.xaml</DependentUpon> </Compile> <Compile Include="Controls\FloatableWindow\FloatableWindow.cs" /> <Compile Include="Controls\FloatableWindow\FloatableWindowAutomationPeer.cs" /> + <Compile Include="Views\LogViewer.xaml.cs"> + <DependentUpon>LogViewer.xaml</DependentUpon> + </Compile> <Compile Include="Converters\BoolToValueConverter.cs" /> <Compile Include="Converters\BoolToVisibilityConverter.cs" /> - <Compile Include="Models\BrokenBinding.cs" /> + <Compile Include="Models\BindingError.cs" /> <Compile Include="Models\ObservableQueue.cs" /> <Compile Include="Models\ValidationWrapper.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="Services\DebugMonitor.cs" /> <Compile Include="Services\Glimpse.cs" /> + <Compile Include="Services\Stopwatch.cs" /> </ItemGroup> <ItemGroup> - <Page Include="Controls\BrokenBindingsViewer.xaml"> + <Page Include="Views\BindingsViewer.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> - <Page Include="Controls\GlimpseViewer.xaml"> + <Page Include="Views\GlimpseViewer.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> - <Page Include="Controls\LoadExceptionViewer.xaml"> + <Page Include="Views\LoadExceptionViewer.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> - <Page Include="Controls\ExceptionsViewer.xaml"> + <Page Include="Views\ExceptionsViewer.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\LogViewer.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightGlimpse/SilverlightGlimpse/Themes/generic.xaml Mon Apr 23 14:54:24 2012 +0100 @@ -0,0 +1,352 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:controls="clr-namespace:System.Windows.Controls" + xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"> + + <Style TargetType="controls:FloatableWindow"> + <Setter Property="IsTabStop" Value="false" /> + <Setter Property="TabNavigation" Value="Cycle" /> + <Setter Property="HorizontalAlignment" Value="Center" /> + <Setter Property="VerticalAlignment" Value="Center" /> + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> + <Setter Property="VerticalContentAlignment" Value="Stretch" /> + <Setter Property="BorderThickness" Value="1" /> + <Setter Property="BorderBrush"> + <Setter.Value> + <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> + <GradientStop Offset="0" Color="#FFA3AEB9" /> + <GradientStop Offset="0.375" Color="#FF8399A9" /> + <GradientStop Offset="0.375" Color="#FF718597" /> + <GradientStop Offset="1" Color="#FF617584" /> + </LinearGradientBrush> + </Setter.Value> + </Setter> + <Setter Property="OverlayBrush"> + <Setter.Value> + <SolidColorBrush Color="#7F000000" /> + </Setter.Value> + </Setter> + <Setter Property="OverlayOpacity" Value="1" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="controls:FloatableWindow"> + <Grid x:Name="Root"> + <Grid.Resources> + <Style x:Key="ButtonStyle" TargetType="Button"> + <Setter Property="Background" Value="#FF1F3B53" /> + <Setter Property="Foreground" Value="#FF000000" /> + <Setter Property="Padding" Value="3" /> + <Setter Property="BorderThickness" Value="1" /> + <Setter Property="BorderBrush"> + <Setter.Value> + <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> + <GradientStop Offset="0" Color="#FFA3AEB9" /> + <GradientStop Offset="0.375" Color="#FF8399A9" /> + <GradientStop Offset="0.375" Color="#FF718597" /> + <GradientStop Offset="1" Color="#FF617584" /> + </LinearGradientBrush> + </Setter.Value> + </Setter> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="Button"> + <Grid x:Name="grid" + Width="15" + Height="14" + HorizontalAlignment="Center" + VerticalAlignment="Center" + Background="#02FFFFFF"> + <vsm:VisualStateManager.VisualStateGroups> + <vsm:VisualStateGroup x:Name="CommonStates"> + <vsm:VisualState x:Name="Normal" /> + <vsm:VisualState x:Name="MouseOver"> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz2" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz1" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz0" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> + </ObjectAnimationUsingKeyFrames> + <DoubleAnimation Duration="0" + Storyboard.TargetName="X" + Storyboard.TargetProperty="Opacity" + To="0.95" /> + </Storyboard> + </vsm:VisualState> + <vsm:VisualState x:Name="Pressed"> + <Storyboard> + <DoubleAnimation Duration="0" + Storyboard.TargetName="X" + Storyboard.TargetProperty="Opacity" + To="0.85" /> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz2" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz1" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz0" Storyboard.TargetProperty="Visibility"> + <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </vsm:VisualState> + <vsm:VisualState x:Name="Disabled"> + <Storyboard> + <DoubleAnimation Duration="0" + Storyboard.TargetName="X" + Storyboard.TargetProperty="Opacity" + To="0.5" /> + </Storyboard> + </vsm:VisualState> + </vsm:VisualStateGroup> + </vsm:VisualStateManager.VisualStateGroups> + <Path x:Name="X_Fuzz2" + Width="9" + Height="8" + Margin="0,-1,0,0" + HorizontalAlignment="Center" + VerticalAlignment="Center" + Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" + Fill="#14C51900" + Opacity="1" + RenderTransformOrigin="0.5,0.5" + Stretch="Fill" + Stroke="#14C51900" + Visibility="Collapsed"> + <Path.RenderTransform> + <TransformGroup> + <ScaleTransform ScaleX="1.3" ScaleY="1.3" /> + </TransformGroup> + </Path.RenderTransform> + </Path> + <Path x:Name="X_Fuzz1" + Width="9" + Height="8" + Margin="0,-1,0,0" + HorizontalAlignment="Center" + VerticalAlignment="Center" + Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" + Fill="#1EC51900" + Opacity="1" + RenderTransformOrigin="0.5,0.5" + Stretch="Fill" + Stroke="#1EC51900" + Visibility="Collapsed"> + <Path.RenderTransform> + <TransformGroup> + <ScaleTransform ScaleX="1.1" ScaleY="1.1" /> + </TransformGroup> + </Path.RenderTransform> + </Path> + <Path x:Name="X_Fuzz0" + Width="9" + Height="8" + Margin="0,-1,0,0" + HorizontalAlignment="Center" + VerticalAlignment="Center" + Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" + Fill="#FFC51900" + Opacity="1" + Stretch="Fill" + Stroke="#FFC51900" + Visibility="Collapsed" /> + <Path x:Name="X" + Width="9" + Height="8" + Margin="0,-1,0,0" + HorizontalAlignment="Center" + VerticalAlignment="Center" + Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" + Fill="#FFFFFFFF" + Opacity="0.7" + Stretch="Fill"> + <Path.Stroke> + <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> + <GradientStop Offset="1" Color="#FF313131" /> + <GradientStop Offset="0" Color="#FF8E9092" /> + </LinearGradientBrush> + </Path.Stroke> + </Path> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + </Grid.Resources> + <vsm:VisualStateManager.VisualStateGroups> + <vsm:VisualStateGroup x:Name="WindowStates"> + <vsm:VisualState x:Name="Open"> + <Storyboard> + <DoubleAnimationUsingKeyFrames BeginTime="0" + Storyboard.TargetName="Overlay" + Storyboard.TargetProperty="Opacity"> + <EasingDoubleKeyFrame KeyTime="0" Value="0" /> + <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="1" /> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames BeginTime="0" + Storyboard.TargetName="ContentRoot" + Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX"> + <SplineDoubleKeyFrame KeyTime="0" Value="0" /> + <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0" /> + <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1" /> + <SplineDoubleKeyFrame KeySpline="0,0,0.5,1" + KeyTime="00:00:00.45" + Value="1.05" /> + <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1" /> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames BeginTime="0" + Storyboard.TargetName="ContentRoot" + Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY"> + <SplineDoubleKeyFrame KeyTime="0" Value="0" /> + <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0" /> + <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1" /> + <SplineDoubleKeyFrame KeySpline="0,0,0.5,1" + KeyTime="00:00:00.45" + Value="1.05" /> + <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1" /> + </DoubleAnimationUsingKeyFrames> + </Storyboard> + </vsm:VisualState> + <vsm:VisualState x:Name="Closed"> + <Storyboard> + <DoubleAnimationUsingKeyFrames BeginTime="0" + Storyboard.TargetName="Overlay" + Storyboard.TargetProperty="Opacity"> + <EasingDoubleKeyFrame KeyTime="0" Value="1" /> + <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="0" /> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames BeginTime="0" + Storyboard.TargetName="ContentRoot" + Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX"> + <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1" /> + <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05" /> + <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0" /> + </DoubleAnimationUsingKeyFrames> + <DoubleAnimationUsingKeyFrames BeginTime="0" + Storyboard.TargetName="ContentRoot" + Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY"> + <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1" /> + <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05" /> + <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0" /> + </DoubleAnimationUsingKeyFrames> + </Storyboard> + </vsm:VisualState> + </vsm:VisualStateGroup> + </vsm:VisualStateManager.VisualStateGroups> + <Grid x:Name="Overlay" + Margin="0" + HorizontalAlignment="Stretch" + VerticalAlignment="Top" + Background="{TemplateBinding OverlayBrush}" + Opacity="{TemplateBinding OverlayOpacity}" /> + <Grid x:Name="ContentRoot" + Width="{TemplateBinding Width}" + Height="{TemplateBinding Height}" + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" + VerticalAlignment="{TemplateBinding VerticalAlignment}" + RenderTransformOrigin="0.5,0.5"> + <Grid.RenderTransform> + <TransformGroup> + <ScaleTransform /> + <SkewTransform /> + <RotateTransform /> + <TranslateTransform /> + </TransformGroup> + </Grid.RenderTransform> + <Border Margin="-1" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + Background="#14000000" + BorderBrush="#14000000" + BorderThickness="1" + CornerRadius="2" /> + <Border Margin="-2" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + Background="#0F000000" + BorderBrush="#0F000000" + BorderThickness="1" + CornerRadius="2.25" /> + <Border Margin="-3" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + Background="#0C000000" + BorderBrush="#0C000000" + BorderThickness="1" + CornerRadius="2.5" /> + <Border Margin="-4" + HorizontalAlignment="Stretch" + VerticalAlignment="Stretch" + Background="#0A000000" + BorderBrush="#0A000000" + BorderThickness="1" + CornerRadius="2.75" /> + <Border Background="#FFFFFFFF" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" + CornerRadius="2"> + <Border Margin="1" CornerRadius="1.5"> + <Border.Background> + <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> + <GradientStop Offset="1" Color="#FFE5E8EB" /> + <GradientStop Offset="0" Color="#FFF6F8F9" /> + </LinearGradientBrush> + </Border.Background> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition /> + </Grid.RowDefinitions> + <Border x:Name="Chrome" + Width="Auto" + BorderBrush="#FFFFFFFF" + BorderThickness="0,0,0,1"> + <Border.Background> + <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,0.528"> + <GradientStop Offset="1" Color="#FFE5E8EB" /> + <GradientStop Offset="0" Color="#FFFEFEFE" /> + </LinearGradientBrush> + </Border.Background> + <Grid Width="Auto" Height="Auto"> + <Grid.ColumnDefinitions> + <ColumnDefinition /> + <ColumnDefinition Width="30" /> + </Grid.ColumnDefinitions> + <ContentControl Margin="6,0,6,0" + HorizontalAlignment="Stretch" + VerticalAlignment="Center" + Content="{TemplateBinding Title}" + FontWeight="Bold" + IsTabStop="False" /> + <Button x:Name="CloseButton" + Grid.Column="1" + Width="15" + Height="14" + HorizontalAlignment="Center" + VerticalAlignment="Center" + IsTabStop="False" + Style="{StaticResource ButtonStyle}" /> + </Grid> + </Border> + <Border Grid.Row="1" + Margin="7" + Background="{TemplateBinding Background}"> + <ContentPresenter x:Name="ContentPresenter" + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" + Content="{TemplateBinding Content}" + ContentTemplate="{TemplateBinding ContentTemplate}" /> + </Border> + </Grid> + </Border> + </Border> + </Grid> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> +</ResourceDictionary> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightGlimpse/SilverlightGlimpse/Views/BindingsViewer.xaml Mon Apr 23 14:54:24 2012 +0100 @@ -0,0 +1,39 @@ +<UserControl x:Class="SilverlightGlimpse.Views.BindingsViewer" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> + + <Grid x:Name="LayoutRoot" Background="White"> + + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + + <StackPanel Grid.Row="0" Orientation="Horizontal"> + <TextBlock Width="145" + Margin="7,0,0,0" + Text="Control Name" /> + <TextBlock Width="120" Text="Type" /> + <TextBlock Width="120" Text="Property" /> + <TextBlock Width="150" Text="Path" /> + <TextBlock Width="50" Text="Quantity" /> + </StackPanel> + + <ScrollViewer Grid.Row="1"> + <ListBox x:Name="lbBindings" ItemsSource="{Binding Mode=OneWay}"> + <ListBox.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Horizontal" ToolTipService.ToolTip="{Binding ToStringProperty}"> + <TextBlock Width="145" Text="{Binding ControlName}" /> + <TextBlock Width="120" Text="{Binding ControlTypeName}" /> + <TextBlock Width="120" Text="{Binding PropertyName}" /> + <TextBlock Width="150" Text="{Binding Path}" /> + <TextBlock Width="50" Text="1" /> + <!-- {Binding Quantity} --> + </StackPanel> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </ScrollViewer> + </Grid> +</UserControl>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightGlimpse/SilverlightGlimpse/Views/BindingsViewer.xaml.cs Mon Apr 23 14:54:24 2012 +0100 @@ -0,0 +1,13 @@ +using SilverlightGlimpse.Services; + +namespace SilverlightGlimpse.Views +{ + public partial class BindingsViewer + { + public BindingsViewer() + { + InitializeComponent(); + lbBindings.DataContext = Glimpse.Service.BindingErrors; + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightGlimpse/SilverlightGlimpse/Views/ExceptionsViewer.xaml Mon Apr 23 14:54:24 2012 +0100 @@ -0,0 +1,97 @@ +<UserControl x:Class="SilverlightGlimpse.Views.ExceptionsViewer" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> + <Grid x:Name="LayoutRoot"> + + <Grid.ColumnDefinitions> + <ColumnDefinition Width="225" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + + <Grid Grid.Row="1"> + <Grid.RowDefinitions> + <RowDefinition Height="*" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + + <ListBox x:Name="lbExceptions" + Margin="3.5" + ItemsSource="{Binding}" + SelectionChanged="lbExceptions_SelectionChanged" /> + + <Button Grid.Row="1" + Width="135" + Margin="7" + HorizontalAlignment="Center" + VerticalAlignment="Center" + Click="ClearExceptions_Click" + Content="Clear Exceptions" /> + </Grid> + <ScrollViewer Grid.Row="1" + Grid.Column="1" + Margin="3.5" + DataContext="{Binding ElementName=lbExceptions, + Path=SelectedItem}"> + <Grid x:Name="gridExceptionDetail" Visibility="Collapsed"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + + <!-- + <TextBlock x:Name="tbAction" + Text="Action" + TextDecorations="Underline" + Visibility="Collapsed" /> + + <TextBlock Grid.Row="1" + FontSize="11" + Text="{Binding Path=Action}" + TextWrapping="Wrap" + Visibility="{Binding ElementName=tbAction, + Path=Visibility}" /> + + <TextBlock Grid.Row="2" + Margin="0,7,0,0" + Text="Control Name" + TextDecorations="Underline" + Visibility="{Binding ElementName=tbAction, + Path=Visibility}" /> + <TextBlock Grid.Row="3" + FontSize="11" + Text="{Binding Path=ControlName}" + TextWrapping="Wrap" + Visibility="{Binding ElementName=tbAction, + Path=Visibility}" /> + --> + + <TextBlock Grid.Row="0" + Margin="0,7,0,0" + Text="Message" + TextDecorations="Underline" /> + + <TextBlock Grid.Row="1" + FontSize="11" + Text="{Binding Path=Message}" + TextWrapping="Wrap" /> + + <TextBlock Grid.Row="2" + Margin="0,7,0,0" + Text="Stack Trace" + TextDecorations="Underline" /> + + <TextBlock Grid.Row="3" + FontSize="11" + Text="{Binding Path=StackTrace}" + TextWrapping="Wrap" /> + + </Grid> + </ScrollViewer> + </Grid> +</UserControl>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightGlimpse/SilverlightGlimpse/Views/ExceptionsViewer.xaml.cs Mon Apr 23 14:54:24 2012 +0100 @@ -0,0 +1,29 @@ +using System.Windows; +using System.Windows.Controls; +using SilverlightGlimpse.Services; + +namespace SilverlightGlimpse.Views +{ + public partial class ExceptionsViewer + { + public ExceptionsViewer() + { + InitializeComponent(); + DataContext = Glimpse.Service.Exceptions; + if (Glimpse.Service.Exceptions.Count > 0) + lbExceptions.SelectedIndex = 0; + } + + private void ClearExceptions_Click(object sender, RoutedEventArgs e) + { + Glimpse.Service.Exceptions.Clear(); + } + + private void lbExceptions_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + gridExceptionDetail.Visibility = lbExceptions.SelectedItem == null + ? Visibility.Collapsed + : Visibility.Visible; + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightGlimpse/SilverlightGlimpse/Views/GlimpseViewer.xaml Mon Apr 23 14:54:24 2012 +0100 @@ -0,0 +1,86 @@ +<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="800" + Height="450"> + + <c:TabItem Header="Bindings"> + <views:BindingsViewer /> + </c:TabItem> + <c:TabItem Header="Validation"> + <views:ExceptionsViewer /> + </c:TabItem> + <c:TabItem Header="Exceptions"> + <views:ExceptionsViewer /> + </c:TabItem> + <c:TabItem Header="Debug" Visibility="{Binding IsInDebugMode, Converter={local:BoolToVisibilityConverter FalseValue=Collapsed, TrueValue=Visible}}"> + <views:LogViewer /> + </c:TabItem> + </c:TabControl> + + </Grid> + </Grid> + +</UserControl>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightGlimpse/SilverlightGlimpse/Views/GlimpseViewer.xaml.cs Mon Apr 23 14:54:24 2012 +0100 @@ -0,0 +1,55 @@ +using System.Collections.Specialized; +using System.Windows; +using SilverlightGlimpse.Services; + +namespace SilverlightGlimpse.Views +{ + public partial class GlimpseViewer + { + public GlimpseViewer() + { + InitializeComponent(); + DataContext = Glimpse.Service; + Glimpse.Service.Exceptions.CollectionChanged += HostExceptions_CollectionChanged; + } + + private void btnContract_Click(object sender, RoutedEventArgs e) + { + layoutViewer.Visibility = Visibility.Collapsed; + } + + private void btnExpand_Click(object sender, RoutedEventArgs e) + { + layoutViewer.Visibility = Visibility.Visible; + } + + // TODO: Sort this mess out :) + private void HostExceptions_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + { + //int unhandledExceptionCount = 0; + //int validationExceptionCount = 0; + + //foreach (var ex in Glimpse.Service.Exceptions) + //{ + // if (ex.IsValidationException) + // validationExceptionCount++; + // else + // unhandledExceptionCount++; + //} + + //tbValidationExceptions.Text = validationExceptionCount.ToString(); + + //if (validationExceptionCount == 0) + //{ + // elpValidationExceptions.Fill = noExceptionsFill; + // elpValidationExceptions.Stroke = noExceptionsBorder; + //} + + //tbUnhandledExceptions.Text = unhandledExceptionCount.ToString(); + + //elpUnhandledExceptions.Fill = unhandledExceptionCount == 0 + // ? noExceptionsBrush + // : hasExceptionsBrush; + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightGlimpse/SilverlightGlimpse/Views/LoadExceptionViewer.xaml Mon Apr 23 14:54:24 2012 +0100 @@ -0,0 +1,64 @@ +<UserControl x:Class="SilverlightGlimpse.Views.LoadExceptionViewer" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> + <Border Width="700" + Height="375" + Margin="11" + BorderBrush="SteelBlue" + BorderThickness="6" + CornerRadius="5"> + <Grid x:Name="LayoutRoot"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="100" /> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + + <Rectangle Fill="SteelBlue" /> + + <TextBlock x:Name="txtTitle" + Margin="3.5" + VerticalAlignment="Center" + Foreground="White" + Text="Exception source goes here from code behind" /> + + <ListBox x:Name="lbExceptions" + Grid.Row="1" + Margin="3.5" + DisplayMemberPath="Message" /> + + <ScrollViewer Grid.Row="2" + Margin="3.5" + Background="White" + DataContext="{Binding ElementName=lbExceptions, + Path=SelectedItem}"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + + <TextBlock Text="Message" TextDecorations="Underline" /> + <TextBlock Grid.Row="1" + Text="{Binding Path=Message}" + TextWrapping="Wrap" /> + + <TextBlock Grid.Row="2" + Margin="0,11,0,0" + Text="Stack Trace" + TextDecorations="Underline" /> + <TextBlock Grid.Row="3" + FontSize="11" + Text="{Binding Path=StackTrace}" + TextWrapping="Wrap" /> + </Grid> + </ScrollViewer> + </Grid> + </Border> + +</UserControl> +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightGlimpse/SilverlightGlimpse/Views/LoadExceptionViewer.xaml.cs Mon Apr 23 14:54:24 2012 +0100 @@ -0,0 +1,30 @@ +using System; + +namespace SilverlightGlimpse.Views +{ + public partial class LoadExceptionViewer + { + public LoadExceptionViewer() + { + InitializeComponent(); + } + + public LoadExceptionViewer(Exception e, string sourceLocation) : this() + { + txtTitle.Text = string.Concat("Exception ", sourceLocation.TrimStart()); + + var ex = e; + + while (ex != null) + { + lbExceptions.Items.Add(ex); + ex = ex.InnerException; + } + + if (lbExceptions.Items.Count > 0) + { + lbExceptions.SelectedIndex = 0; + } + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightGlimpse/SilverlightGlimpse/Views/LogViewer.xaml Mon Apr 23 14:54:24 2012 +0100 @@ -0,0 +1,25 @@ +<UserControl x:Class="SilverlightGlimpse.Views.LogViewer" + 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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + mc:Ignorable="d"> + + <Grid x:Name="LayoutRoot"> + <Grid.RowDefinitions> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + + <ScrollViewer> + <ListBox x:Name="lbLog" ItemsSource="{Binding Mode=OneWay}"> + <ListBox.ItemTemplate> + <DataTemplate> + <TextBlock Width="Auto" + Height="Auto" + Text="{Binding}" /> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </ScrollViewer> + </Grid> +</UserControl>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SilverlightGlimpse/SilverlightGlimpse/Views/LogViewer.xaml.cs Mon Apr 23 14:54:24 2012 +0100 @@ -0,0 +1,13 @@ +using SilverlightGlimpse.Services; + +namespace SilverlightGlimpse.Views +{ + public partial class LogViewer + { + public LogViewer() + { + InitializeComponent(); + lbLog.DataContext = Glimpse.Service.Log; + } + } +} \ No newline at end of file
--- a/SilverlightGlimpse/SilverlightGlimpse/themes/generic.xaml Mon Apr 23 11:06:29 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,352 +0,0 @@ -<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:controls="clr-namespace:System.Windows.Controls" - xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"> - - <Style TargetType="controls:FloatableWindow"> - <Setter Property="IsTabStop" Value="false" /> - <Setter Property="TabNavigation" Value="Cycle" /> - <Setter Property="HorizontalAlignment" Value="Center" /> - <Setter Property="VerticalAlignment" Value="Center" /> - <Setter Property="HorizontalContentAlignment" Value="Stretch" /> - <Setter Property="VerticalContentAlignment" Value="Stretch" /> - <Setter Property="BorderThickness" Value="1" /> - <Setter Property="BorderBrush"> - <Setter.Value> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Offset="0" Color="#FFA3AEB9" /> - <GradientStop Offset="0.375" Color="#FF8399A9" /> - <GradientStop Offset="0.375" Color="#FF718597" /> - <GradientStop Offset="1" Color="#FF617584" /> - </LinearGradientBrush> - </Setter.Value> - </Setter> - <Setter Property="OverlayBrush"> - <Setter.Value> - <SolidColorBrush Color="#7F000000" /> - </Setter.Value> - </Setter> - <Setter Property="OverlayOpacity" Value="1" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="controls:FloatableWindow"> - <Grid x:Name="Root"> - <Grid.Resources> - <Style x:Key="ButtonStyle" TargetType="Button"> - <Setter Property="Background" Value="#FF1F3B53" /> - <Setter Property="Foreground" Value="#FF000000" /> - <Setter Property="Padding" Value="3" /> - <Setter Property="BorderThickness" Value="1" /> - <Setter Property="BorderBrush"> - <Setter.Value> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Offset="0" Color="#FFA3AEB9" /> - <GradientStop Offset="0.375" Color="#FF8399A9" /> - <GradientStop Offset="0.375" Color="#FF718597" /> - <GradientStop Offset="1" Color="#FF617584" /> - </LinearGradientBrush> - </Setter.Value> - </Setter> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="Button"> - <Grid x:Name="grid" - Width="15" - Height="14" - HorizontalAlignment="Center" - VerticalAlignment="Center" - Background="#02FFFFFF"> - <vsm:VisualStateManager.VisualStateGroups> - <vsm:VisualStateGroup x:Name="CommonStates"> - <vsm:VisualState x:Name="Normal" /> - <vsm:VisualState x:Name="MouseOver"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz2" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz1" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz0" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - <DoubleAnimation Duration="0" - Storyboard.TargetName="X" - Storyboard.TargetProperty="Opacity" - To="0.95" /> - </Storyboard> - </vsm:VisualState> - <vsm:VisualState x:Name="Pressed"> - <Storyboard> - <DoubleAnimation Duration="0" - Storyboard.TargetName="X" - Storyboard.TargetProperty="Opacity" - To="0.85" /> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz2" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz1" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz0" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </vsm:VisualState> - <vsm:VisualState x:Name="Disabled"> - <Storyboard> - <DoubleAnimation Duration="0" - Storyboard.TargetName="X" - Storyboard.TargetProperty="Opacity" - To="0.5" /> - </Storyboard> - </vsm:VisualState> - </vsm:VisualStateGroup> - </vsm:VisualStateManager.VisualStateGroups> - <Path x:Name="X_Fuzz2" - Width="9" - Height="8" - Margin="0,-1,0,0" - HorizontalAlignment="Center" - VerticalAlignment="Center" - Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" - Fill="#14C51900" - Opacity="1" - RenderTransformOrigin="0.5,0.5" - Stretch="Fill" - Stroke="#14C51900" - Visibility="Collapsed"> - <Path.RenderTransform> - <TransformGroup> - <ScaleTransform ScaleX="1.3" ScaleY="1.3" /> - </TransformGroup> - </Path.RenderTransform> - </Path> - <Path x:Name="X_Fuzz1" - Width="9" - Height="8" - Margin="0,-1,0,0" - HorizontalAlignment="Center" - VerticalAlignment="Center" - Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" - Fill="#1EC51900" - Opacity="1" - RenderTransformOrigin="0.5,0.5" - Stretch="Fill" - Stroke="#1EC51900" - Visibility="Collapsed"> - <Path.RenderTransform> - <TransformGroup> - <ScaleTransform ScaleX="1.1" ScaleY="1.1" /> - </TransformGroup> - </Path.RenderTransform> - </Path> - <Path x:Name="X_Fuzz0" - Width="9" - Height="8" - Margin="0,-1,0,0" - HorizontalAlignment="Center" - VerticalAlignment="Center" - Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" - Fill="#FFC51900" - Opacity="1" - Stretch="Fill" - Stroke="#FFC51900" - Visibility="Collapsed" /> - <Path x:Name="X" - Width="9" - Height="8" - Margin="0,-1,0,0" - HorizontalAlignment="Center" - VerticalAlignment="Center" - Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" - Fill="#FFFFFFFF" - Opacity="0.7" - Stretch="Fill"> - <Path.Stroke> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Offset="1" Color="#FF313131" /> - <GradientStop Offset="0" Color="#FF8E9092" /> - </LinearGradientBrush> - </Path.Stroke> - </Path> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - </Grid.Resources> - <vsm:VisualStateManager.VisualStateGroups> - <vsm:VisualStateGroup x:Name="WindowStates"> - <vsm:VisualState x:Name="Open"> - <Storyboard> - <DoubleAnimationUsingKeyFrames BeginTime="0" - Storyboard.TargetName="Overlay" - Storyboard.TargetProperty="Opacity"> - <EasingDoubleKeyFrame KeyTime="0" Value="0" /> - <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="1" /> - </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames BeginTime="0" - Storyboard.TargetName="ContentRoot" - Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX"> - <SplineDoubleKeyFrame KeyTime="0" Value="0" /> - <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0" /> - <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1" /> - <SplineDoubleKeyFrame KeySpline="0,0,0.5,1" - KeyTime="00:00:00.45" - Value="1.05" /> - <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1" /> - </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames BeginTime="0" - Storyboard.TargetName="ContentRoot" - Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY"> - <SplineDoubleKeyFrame KeyTime="0" Value="0" /> - <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0" /> - <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1" /> - <SplineDoubleKeyFrame KeySpline="0,0,0.5,1" - KeyTime="00:00:00.45" - Value="1.05" /> - <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1" /> - </DoubleAnimationUsingKeyFrames> - </Storyboard> - </vsm:VisualState> - <vsm:VisualState x:Name="Closed"> - <Storyboard> - <DoubleAnimationUsingKeyFrames BeginTime="0" - Storyboard.TargetName="Overlay" - Storyboard.TargetProperty="Opacity"> - <EasingDoubleKeyFrame KeyTime="0" Value="1" /> - <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="0" /> - </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames BeginTime="0" - Storyboard.TargetName="ContentRoot" - Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX"> - <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1" /> - <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05" /> - <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0" /> - </DoubleAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames BeginTime="0" - Storyboard.TargetName="ContentRoot" - Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY"> - <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1" /> - <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05" /> - <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0" /> - </DoubleAnimationUsingKeyFrames> - </Storyboard> - </vsm:VisualState> - </vsm:VisualStateGroup> - </vsm:VisualStateManager.VisualStateGroups> - <Grid x:Name="Overlay" - Margin="0" - HorizontalAlignment="Stretch" - VerticalAlignment="Top" - Background="{TemplateBinding OverlayBrush}" - Opacity="{TemplateBinding OverlayOpacity}" /> - <Grid x:Name="ContentRoot" - Width="{TemplateBinding Width}" - Height="{TemplateBinding Height}" - HorizontalAlignment="{TemplateBinding HorizontalAlignment}" - VerticalAlignment="{TemplateBinding VerticalAlignment}" - RenderTransformOrigin="0.5,0.5"> - <Grid.RenderTransform> - <TransformGroup> - <ScaleTransform /> - <SkewTransform /> - <RotateTransform /> - <TranslateTransform /> - </TransformGroup> - </Grid.RenderTransform> - <Border Margin="-1" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" - Background="#14000000" - BorderBrush="#14000000" - BorderThickness="1" - CornerRadius="2" /> - <Border Margin="-2" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" - Background="#0F000000" - BorderBrush="#0F000000" - BorderThickness="1" - CornerRadius="2.25" /> - <Border Margin="-3" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" - Background="#0C000000" - BorderBrush="#0C000000" - BorderThickness="1" - CornerRadius="2.5" /> - <Border Margin="-4" - HorizontalAlignment="Stretch" - VerticalAlignment="Stretch" - Background="#0A000000" - BorderBrush="#0A000000" - BorderThickness="1" - CornerRadius="2.75" /> - <Border Background="#FFFFFFFF" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="2"> - <Border Margin="1" CornerRadius="1.5"> - <Border.Background> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Offset="1" Color="#FFE5E8EB" /> - <GradientStop Offset="0" Color="#FFF6F8F9" /> - </LinearGradientBrush> - </Border.Background> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition /> - </Grid.RowDefinitions> - <Border x:Name="Chrome" - Width="Auto" - BorderBrush="#FFFFFFFF" - BorderThickness="0,0,0,1"> - <Border.Background> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,0.528"> - <GradientStop Offset="1" Color="#FFE5E8EB" /> - <GradientStop Offset="0" Color="#FFFEFEFE" /> - </LinearGradientBrush> - </Border.Background> - <Grid Width="Auto" Height="Auto"> - <Grid.ColumnDefinitions> - <ColumnDefinition /> - <ColumnDefinition Width="30" /> - </Grid.ColumnDefinitions> - <ContentControl Margin="6,0,6,0" - HorizontalAlignment="Stretch" - VerticalAlignment="Center" - Content="{TemplateBinding Title}" - FontWeight="Bold" - IsTabStop="False" /> - <Button x:Name="CloseButton" - Grid.Column="1" - Width="15" - Height="14" - HorizontalAlignment="Center" - VerticalAlignment="Center" - IsTabStop="False" - Style="{StaticResource ButtonStyle}" /> - </Grid> - </Border> - <Border Grid.Row="1" - Margin="7" - Background="{TemplateBinding Background}"> - <ContentPresenter x:Name="ContentPresenter" - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" - Content="{TemplateBinding Content}" - ContentTemplate="{TemplateBinding ContentTemplate}" /> - </Border> - </Grid> - </Border> - </Border> - </Grid> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> -</ResourceDictionary> \ No newline at end of file
--- a/SilverlightGlimpse/SilverlightValidation/App.xaml.cs Mon Apr 23 11:06:29 2012 +0100 +++ b/SilverlightGlimpse/SilverlightValidation/App.xaml.cs Mon Apr 23 14:54:24 2012 +0100 @@ -1,13 +1,10 @@ using System; using System.Windows; -using System.Windows.Controls; -using System.Windows.Navigation; using SilverlightGlimpse.Services; -using System.Diagnostics; namespace SilverlightValidation { - public partial class App : Application + public partial class App { public App() { @@ -20,11 +17,11 @@ private void Application_Startup(object sender, StartupEventArgs e) { - string appName = "Silverlight Glimpse"; + const string appName = "Silverlight Glimpse"; try { this.RootVisual = new Views.UserListView(); - Glimpse.Service.Load(this, appName); + Glimpse.Service.Load(this, appName, new TimeSpan(0,0,0,10)); } catch (Exception ex) {
--- a/SilverlightGlimpse/SilverlightValidation/Data/Factory.cs Mon Apr 23 11:06:29 2012 +0100 +++ b/SilverlightGlimpse/SilverlightValidation/Data/Factory.cs Mon Apr 23 14:54:24 2012 +0100 @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using SilverlightValidation.Models; namespace SilverlightValidation.Data
--- a/SilverlightGlimpse/SilverlightValidation/ViewModels/UserListViewModel.cs Mon Apr 23 11:06:29 2012 +0100 +++ b/SilverlightGlimpse/SilverlightValidation/ViewModels/UserListViewModel.cs Mon Apr 23 14:54:24 2012 +0100 @@ -1,4 +1,5 @@ -using System.Collections.ObjectModel; +using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Windows.Input; using SilverlightValidation.Commands; using SilverlightValidation.Models;
--- a/SilverlightGlimpse/SilverlightValidation/ViewModels/ViewModelBase.cs Mon Apr 23 11:06:29 2012 +0100 +++ b/SilverlightGlimpse/SilverlightValidation/ViewModels/ViewModelBase.cs Mon Apr 23 14:54:24 2012 +0100 @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using System.ComponentModel; using System.Linq;
--- a/SilverlightGlimpse/SilverlightValidation/Views/UserListView.xaml Mon Apr 23 11:06:29 2012 +0100 +++ b/SilverlightGlimpse/SilverlightValidation/Views/UserListView.xaml Mon Apr 23 14:54:24 2012 +0100 @@ -71,7 +71,7 @@ </sdk:DataGridTemplateColumn.CellTemplate> </controls:DataGridTemplateColumn> <controls:DataGridTextColumn Width="150" - Binding="{Binding Description, + Binding="{Binding INCORRECTPATH, Mode=TwoWay, ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}"
--- a/SilverlightGlimpse/SilverlightValidation/Views/UserListView.xaml.cs Mon Apr 23 11:06:29 2012 +0100 +++ b/SilverlightGlimpse/SilverlightValidation/Views/UserListView.xaml.cs Mon Apr 23 14:54:24 2012 +0100 @@ -8,12 +8,12 @@ { public partial class UserListView { - private UserListViewModel vm; + private readonly UserListViewModel vm; public UserListView() { InitializeComponent(); - HtmlPage.Document.SetProperty("title", "Silverlight Validation"); + HtmlPage.Document.SetProperty("title", "Silverlight Glimpse Demo"); vm = new UserListViewModel(Factory.CreateUserModels(), new UserModelValidator()); this.DataContext = vm;