Mercurial > silverbladetech
changeset 87:8bb84cc9ba3f
Clear out rubbish
author | stevenhollidge <stevenhollidge@hotmail.com> |
---|---|
date | Thu, 26 Apr 2012 13:23:35 +0100 |
parents | 2084cfd89b80 |
children | e84dc4926a5a |
files | Glimpse/Glimpse Controls/BrokenBindingsViewer.xaml Glimpse/Glimpse Controls/BrokenBindingsViewer.xaml.vb Glimpse/Glimpse Controls/ExceptionsViewer.xaml Glimpse/Glimpse Controls/ExceptionsViewer.xaml.vb Glimpse/Glimpse Controls/GlimpseViewer.xaml Glimpse/Glimpse Controls/GlimpseViewer.xaml.vb Glimpse/Glimpse Controls/LoadExceptionViewer.xaml Glimpse/Glimpse Controls/LoadExceptionViewer.xaml.vb Glimpse/Glimpse Services/GlimpseService.vb Glimpse/Glimpse.Old.vbproj Glimpse/Glimpse.Old.vbproj.user Glimpse/Glimpse.csi Glimpse/Model/BrokenBinding.vb Glimpse/Model/ExceptionWrapper.vb Glimpse/My Project/AssemblyInfo.vb SilverlightValidation/SilverlightValidation.Web/ClientBin/SilverlightValidation.xap delete me/Glimpse/Glimpse Controls/BrokenBindingsViewer.xaml delete me/Glimpse/Glimpse Controls/BrokenBindingsViewer.xaml.vb delete me/Glimpse/Glimpse Controls/ExceptionsViewer.xaml delete me/Glimpse/Glimpse Controls/ExceptionsViewer.xaml.vb delete me/Glimpse/Glimpse Controls/GlimpseViewer.xaml delete me/Glimpse/Glimpse Controls/GlimpseViewer.xaml.vb delete me/Glimpse/Glimpse Controls/LoadExceptionViewer.xaml delete me/Glimpse/Glimpse Controls/LoadExceptionViewer.xaml.vb delete me/Glimpse/Glimpse Services/GlimpseService.vb delete me/Glimpse/Glimpse.csi delete me/Glimpse/Glimpse.vbproj delete me/Glimpse/Glimpse.vbproj.user delete me/Glimpse/Model/BrokenBinding.vb delete me/Glimpse/Model/ExceptionWrapper.vb delete me/Glimpse/My Project/AssemblyInfo.vb delete me/Libs/FloatableWindow.dll delete me/Libs/FluentValidation.dll delete me/Libs/SilverlightGlimpse.dll delete me/Libs/SilverlightGlimpse.xap delete me/Libs/System.Windows.Controls.Data.Input.dll delete me/Libs/System.Windows.Controls.Data.dll delete me/Libs/System.Windows.Controls.Navigation.dll delete me/Libs/System.Windows.Controls.dll delete me/SilverlightValidation.Web/ClientBin/SilverlightValidation.xap delete me/SilverlightValidation.Web/Properties/AssemblyInfo.cs delete me/SilverlightValidation.Web/Silverlight.js delete me/SilverlightValidation.Web/SilverlightValidation.Web.csproj delete me/SilverlightValidation.Web/Web.Debug.config delete me/SilverlightValidation.Web/Web.Release.config delete me/SilverlightValidation.Web/Web.config delete me/SilverlightValidation.Web/index.html delete me/SilverlightValidation.sln delete me/SilverlightValidation/App.xaml delete me/SilverlightValidation/App.xaml.cs delete me/SilverlightValidation/Commands/RelayCommand.cs delete me/SilverlightValidation/Data/Factory.cs delete me/SilverlightValidation/Diagrams/Form.cd delete me/SilverlightValidation/Diagrams/List.cd delete me/SilverlightValidation/Interfaces/ICloneable.cs delete me/SilverlightValidation/Interfaces/IUserModel.cs delete me/SilverlightValidation/Models/UserModel.cs delete me/SilverlightValidation/Properties/AppManifest.xml delete me/SilverlightValidation/Properties/AssemblyInfo.cs delete me/SilverlightValidation/SilverlightValidation.csproj delete me/SilverlightValidation/Validators/UserModelValidator.cs delete me/SilverlightValidation/ViewModels/UserListViewModel.cs delete me/SilverlightValidation/ViewModels/UserViewModel.cs delete me/SilverlightValidation/ViewModels/ViewModelBase.cs delete me/SilverlightValidation/Views/UserListView.xaml delete me/SilverlightValidation/Views/UserListView.xaml.cs delete me/SilverlightValidation/Views/UserView.xaml delete me/SilverlightValidation/Views/UserView.xaml.cs |
diffstat | 68 files changed, 0 insertions(+), 4285 deletions(-) [+] |
line wrap: on
line diff
--- a/Glimpse/Glimpse Controls/BrokenBindingsViewer.xaml Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -<UserControl x:Class="Glimpse.BrokenBindingsViewer" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> - <Grid x:Name="LayoutRoot" Background="White"> - <ScrollViewer> - <ItemsControl x:Name="icBrokenBindings" /> - </ScrollViewer> - </Grid> -</UserControl>
--- a/Glimpse/Glimpse Controls/BrokenBindingsViewer.xaml.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -Imports System.Reflection -Imports System.Windows.Data -Partial Public Class BrokenBindingsViewer - Inherits UserControl - - Public Sub New() - InitializeComponent() - End Sub - - Private Sub BrokenBindings_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded - Me.icBrokenBindings.Items.Clear() - LoadBrokenBindings(GlimpseService.CreateInstance.RootVisual) - End Sub - - Private Sub LoadBrokenBindings(ByVal uie As UIElement) - - Dim fwe As FrameworkElement = TryCast(uie, FrameworkElement) - - If fwe IsNot Nothing Then - - For Each fi As FieldInfo In fwe.GetType.GetFields(BindingFlags.Public Or BindingFlags.FlattenHierarchy Or BindingFlags.Instance Or BindingFlags.Static) - - If fi.FieldType Is GetType(DependencyProperty) Then - - Dim be As BindingExpression = fwe.GetBindingExpression(DirectCast(fi.GetValue(Nothing), DependencyProperty)) - - If be IsNot Nothing AndAlso be.ParentBinding.Source Is Nothing AndAlso be.ParentBinding.RelativeSource Is Nothing Then - - Dim bolIsInherited As Boolean = False - - If fwe.DataContext IsNot Nothing AndAlso Not String.IsNullOrEmpty(be.ParentBinding.Path.Path) Then - - For Each p As PropertyInfo In fwe.DataContext.GetType.GetProperties(BindingFlags.Public Or BindingFlags.FlattenHierarchy Or BindingFlags.Static Or BindingFlags.Instance) - - If String.Compare(p.Name, be.ParentBinding.Path.Path) = 0 Then - bolIsInherited = True - Exit For - End If - - Next - - End If - - If bolIsInherited Then - Exit For - End If - - '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 fwe.Name = "" AndAlso fwe.GetType.Name = "TextBlock" AndAlso fi.Name = "TextProperty" AndAlso be.ParentBinding.Path.Path = "" Then - Exit For - End If - - Dim objBrokenBinding As New BrokenBinding(fwe.Name, fwe.GetType.Name, fi.Name, be.ParentBinding.Path.Path) - Me.icBrokenBindings.Items.Add(objBrokenBinding) - System.Diagnostics.Debug.WriteLine(String.Format("Broken Binding - ", objBrokenBinding.ToString)) - End If - - End If - - Next - - Dim children As Integer = VisualTreeHelper.GetChildrenCount(fwe) - - For intX As Integer = 0 To children - 1 - - Dim child As FrameworkElement = TryCast(VisualTreeHelper.GetChild(fwe, intX), FrameworkElement) - - If child IsNot Nothing Then - LoadBrokenBindings(child) - End If - - Next - - End If - - End Sub - -End Class
--- a/Glimpse/Glimpse Controls/ExceptionsViewer.xaml Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -<UserControl - x:Class="Glimpse.ExceptionsViewer" - 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.ColumnDefinitions> - <ColumnDefinition Width="250" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="*" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - - <TextBlock Margin="3.5" Grid.ColumnSpan="2" FontSize="18" Foreground="Red" Text="Exceptions Viewer" VerticalAlignment="Center" /> - - <ListBox SelectionChanged="lbExceptions_SelectionChanged" ItemsSource="{Binding}" x:Name="lbExceptions" Margin="3.5" Grid.Row="1" /> - - <ScrollViewer DataContext="{Binding ElementName=lbExceptions, Path=SelectedItem}" Grid.Column="1" Grid.Row="1" Margin="3.5"> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - - <Rectangle Fill="BlanchedAlmond" /> - <TextBlock x:Name="tbAction" Text="Action" TextDecorations="Underline" FontSize="14" /> - <TextBlock Visibility="{Binding ElementName=tbAction, Path=Visibility}" Grid.Row="1" Text="{Binding Path=Action}" FontSize="11" TextWrapping="Wrap" /> - - <Rectangle Grid.Row="2" Fill="BlanchedAlmond" /> - <TextBlock Visibility="{Binding ElementName=tbAction, Path=Visibility}" Grid.Row="2" Text="Control Name" TextDecorations="Underline" Margin="0,7,0,0" FontSize="14" /> - <TextBlock Visibility="{Binding ElementName=tbAction, Path=Visibility}" Grid.Row="3" Text="{Binding Path=ControlName}" FontSize="11" TextWrapping="Wrap" /> - - <Rectangle Grid.Row="4" Fill="BlanchedAlmond" /> - <TextBlock Grid.Row="4" Text="Message" TextDecorations="Underline" FontSize="14" Margin="0,7,0,0" /> - <TextBlock Grid.Row="5" Text="{Binding Path=Exception.Message}" FontSize="11" TextWrapping="Wrap" /> - - <Rectangle Grid.Row="6" Fill="BlanchedAlmond" /> - <TextBlock Grid.Row="6" Text="Stack Trace" TextDecorations="Underline" FontSize="14" Margin="0,7,0,0" /> - <TextBlock Grid.Row="7" Text="{Binding Path=Exception.StackTrace}" FontSize="11" TextWrapping="Wrap" /> - - </Grid> - </ScrollViewer> - <Button Grid.Column="1" Grid.Row="2" Click="ClearExceptions_Click" Padding="7" Content="Clear Exceptions" Margin="11" HorizontalAlignment="Right" VerticalAlignment="Center" /> - </Grid> - -</UserControl>
--- a/Glimpse/Glimpse Controls/ExceptionsViewer.xaml.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -Partial Public Class ExceptionsViewer - Inherits UserControl - - Public Sub New() - InitializeComponent() - End Sub - - Private Sub ClearExceptions_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) - GlimpseService.CreateInstance.HostExceptions.Clear() - End Sub - - Private Sub ExceptionsViewer_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded - Me.DataContext = GlimpseService.CreateInstance.HostExceptions - If GlimpseService.CreateInstance.HostExceptions.Count > 0 Then - Me.lbExceptions.SelectedIndex = 0 - End If - End Sub - - Private Sub lbExceptions_SelectionChanged(ByVal sender As System.Object, ByVal e As System.Windows.Controls.SelectionChangedEventArgs) - - If Me.lbExceptions.SelectedItem IsNot Nothing AndAlso TypeOf Me.lbExceptions.SelectedItem Is ExceptionWrapper Then - - If DirectCast(Me.lbExceptions.SelectedItem, ExceptionWrapper).IsValidationException Then - Me.tbAction.Visibility = Windows.Visibility.Visible - - Else - Me.tbAction.Visibility = Windows.Visibility.Collapsed - End If - - End If - - End Sub - -End Class
--- a/Glimpse/Glimpse Controls/GlimpseViewer.xaml Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -<UserControl xmlns:local="clr-namespace:Glimpse" xmlns:swc="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" x:Class="Glimpse.GlimpseViewer" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> - <Grid x:Name="LayoutRoot" Background="Khaki"> - <Grid.Resources> - <SolidColorBrush Color="LightGreen" x:Name="noExceptionsBrush" /> - <SolidColorBrush Color="Red" x:Name="hasExceptionsBrush" /> - </Grid.Resources> - <Grid x:Name="layoutInstrumentPanel"> - <StackPanel Orientation="Horizontal"> - <Grid Margin="7"> - <Ellipse x:Name="elpValidationExceptions" StrokeThickness="2" Stroke="Brown" Fill="LightGreen" Height="40" Width="40"/> - <TextBlock x:Name="tbValidationExceptions" Text="0" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12" FontWeight="Bold" ToolTipService.ToolTip="Binding Exception Count" /> - </Grid> - <Grid Margin="7"> - <Ellipse x:Name="elpUnhandledExceptions" StrokeThickness="2" Stroke="Brown" Fill="LightGreen" Height="40" Width="40" /> - <TextBlock x:Name="tbUnhandledExceptions" Text="0" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12" FontWeight="Bold" ToolTipService.ToolTip="Unhandled Exception Count" /> - </Grid> - <Button x:Name="btnExpand" Margin="7" Content="Expand" VerticalAlignment="Center" /> - </StackPanel> - </Grid> - <Grid x:Name="layoutViewer" Visibility="Collapsed"> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="*" /> - </Grid.RowDefinitions> - <TextBlock Margin="3.5" FontSize="18" Foreground="DarkGreen" Text="Glimpse Viewer" VerticalAlignment="Center" /> - <Button x:Name="btnContract" Margin="7" Content="Contract" VerticalAlignment="Center" HorizontalAlignment="Right" /> - <swc:TabControl Background="Khaki" Grid.Row="1" Height="390" Width="690" SelectedIndex="2"> - <swc:TabItem Header="Exceptions"> - <local:ExceptionsViewer /> - </swc:TabItem> - <swc:TabItem Header="Bindings with no Source"> - <local:BrokenBindingsViewer /> - </swc:TabItem> - </swc:TabControl> - </Grid> - </Grid> - -</UserControl>
--- a/Glimpse/Glimpse Controls/GlimpseViewer.xaml.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -Partial Public Class GlimpseViewer - Inherits UserControl - - Public Sub New() - InitializeComponent() - Me.DataContext = GlimpseService.CreateInstance - AddHandler GlimpseService.CreateInstance.HostExceptions.CollectionChanged, AddressOf HostExceptions_CollectionChanged - End Sub - - Private Sub btnContract_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnContract.Click - Me.layoutViewer.Visibility = Windows.Visibility.Collapsed - End Sub - - Private Sub btnExpand_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnExpand.Click - Me.layoutViewer.Visibility = Windows.Visibility.Visible - End Sub - - Private Sub HostExceptions_CollectionChanged(ByVal sender As Object, ByVal e As System.Collections.Specialized.NotifyCollectionChangedEventArgs) - - Dim intUnhandledExceptionCount As Integer = 0 - Dim intValidationExceptionCount As Integer = 0 - - For Each ew As ExceptionWrapper In GlimpseService.CreateInstance.HostExceptions - - If ew.IsValidationException Then - intValidationExceptionCount += 1 - - Else - intUnhandledExceptionCount += 1 - End If - - Next - - Me.tbValidationExceptions.Text = intValidationExceptionCount.ToString - - If intValidationExceptionCount = 0 Then - Me.elpValidationExceptions.Fill = Me.noExceptionsBrush - - Else - Me.elpValidationExceptions.Fill = Me.hasExceptionsBrush - End If - - Me.tbUnhandledExceptions.Text = intUnhandledExceptionCount.ToString - - If intUnhandledExceptionCount = 0 Then - Me.elpUnhandledExceptions.Fill = Me.noExceptionsBrush - - Else - Me.elpUnhandledExceptions.Fill = Me.hasExceptionsBrush - End If - - End Sub - -End Class
--- a/Glimpse/Glimpse Controls/LoadExceptionViewer.xaml Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -<UserControl x:Class="Glimpse.LoadExceptionViewer" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> - <Border Height="375" Width="700" Margin="11" BorderBrush="Red" BorderThickness="2" Padding="11" Background="LightYellow" CornerRadius="20"> - <Grid x:Name="LayoutRoot"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="200" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="*" /> - </Grid.RowDefinitions> - <TextBlock Margin="3.5" Grid.ColumnSpan="2" FontSize="18" Foreground="Red" Text="Exception Viewer" VerticalAlignment="Center" /> - - <ListBox x:Name="lbExceptions" Margin="3.5" Grid.Row="1" DisplayMemberPath="Message" /> - - <TextBlock FontSize="14" Grid.ColumnSpan="2" x:Name="txtSourceLocation" VerticalAlignment="Center" HorizontalAlignment="Right" /> - <ScrollViewer Background="White" DataContext="{Binding ElementName=lbExceptions, Path=SelectedItem}" Grid.Column="1" Grid.Row="1" Margin="3.5"> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - <Rectangle Fill="BlanchedAlmond" /> - <TextBlock Text="Message" TextDecorations="Underline" FontSize="14" /> - <TextBlock Grid.Row="1" Text="{Binding Path=Message}" FontSize="11" TextWrapping="Wrap" /> - - <Rectangle Grid.Row="2" Fill="BlanchedAlmond" /> - <TextBlock Grid.Row="2" Text="Stack Trace" TextDecorations="Underline" FontSize="14" Margin="0,11,0,0" /> - <TextBlock Grid.Row="3" Text="{Binding Path=StackTrace}" FontSize="11" TextWrapping="Wrap" /> - - </Grid> - </ScrollViewer> - </Grid> - </Border> - -</UserControl>
--- a/Glimpse/Glimpse Controls/LoadExceptionViewer.xaml.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -Partial Public Class LoadExceptionViewer - Inherits UserControl - - Public Sub New() - InitializeComponent() - End Sub - - Public Sub New(ByVal e As Exception, ByVal strSourceLocation As String) - InitializeComponent() - Me.txtSourceLocation.Text = String.Concat("Source Location: ", strSourceLocation) - - Dim ex As Exception = e - - While ex IsNot Nothing - Me.lbExceptions.Items.Add(ex) - ex = ex.InnerException - End While - - If Me.lbExceptions.Items.Count > 0 Then - Me.lbExceptions.SelectedIndex = 0 - End If - - End Sub - -End Class
--- a/Glimpse/Glimpse Services/GlimpseService.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -Imports System.Diagnostics -Imports System.Collections.ObjectModel -Imports System.ComponentModel - -Public Class GlimpseService - -#Region " Declarations " - - Private Shared _instance As GlimpseService - Private _objGlimpseWindow As ChildWindow - Private _objHostExceptions As New ObservableCollection(Of ExceptionWrapper) - Private _strHostApplicationName As String = String.Empty - Private WithEvents _objApp As Application - Private WithEvents _objRootVisual As FrameworkElement - -#End Region - -#Region " Properties " - - Public Shared ReadOnly Property CreateInstance() As GlimpseService - Get - - If _instance Is Nothing Then - _instance = New GlimpseService - End If - - Return _instance - End Get - End Property - - Friend Property App() As Application - Get - Return _objApp - End Get - Set(ByVal Value As Application) - _objApp = Value - End Set - End Property - - Friend Property GlimpseWindow() As ChildWindow - Get - Return _objGlimpseWindow - End Get - - Private Set(ByVal Value As ChildWindow) - _objGlimpseWindow = Value - End Set - End Property - - Friend Property HostApplicationName() As String - Get - Return _strHostApplicationName - End Get - Set(ByVal Value As String) - _strHostApplicationName = Value - End Set - End Property - - Friend ReadOnly Property HostExceptions() As ObservableCollection(Of ExceptionWrapper) - Get - Return _objHostExceptions - End Get - End Property - - Friend Property RootVisual() As FrameworkElement - Get - Return _objRootVisual - End Get - Set(ByVal Value As FrameworkElement) - _objRootVisual = Value - End Set - End Property - -#End Region - -#Region " Creation and Loading " - - Public Sub DisplayLoadFailure(ByVal objApp As Application, ByVal ex As Exception, ByVal strHostApplicationName As String) - Debug.WriteLine(String.Format("{0} had exception. {1}", Me.HostApplicationName, ex.ToString)) - _objApp = objApp - _objApp.RootVisual = New LoadExceptionViewer(ex, strHostApplicationName) - End Sub - - Public Sub Load(ByVal objApp As Application, ByVal strHostApplicationName As String) - Me.App = objApp - Me.RootVisual = TryCast(objApp.RootVisual, FrameworkElement) - Me.HostApplicationName = strHostApplicationName - - Dim fw As New FloatableWindow() - fw.Title = Me.HostApplicationName - fw.Content = New GlimpseViewer - fw.ParentLayoutRoot = DirectCast(VisualTreeHelper.GetChild(RootVisual, 0), Panel) - - If Double.IsNaN(Me.RootVisual.Width) Then - 'if the host control is autosized (consumes the browser window) then locate Glimpse in the top, left - fw.Show() - - Else - - 'if the host is fixed size then attempt to locate the popup control in the upper right corner - Dim dblLeft As Double = Me.RootVisual.Width - 200 - - If dblLeft < 0 Then - dblLeft = 0 - End If - - fw.Show(dblLeft, 10) - End If - - End Sub - - Private Sub New() - End Sub - -#End Region - -#Region " Host Application Events " - - Private Sub _objHostRootVisual_BindingValidationError(ByVal sender As Object, ByVal e As System.Windows.Controls.ValidationErrorEventArgs) Handles _objRootVisual.BindingValidationError - - Dim strControlName As String = "(none)" - Dim objControl As Control = TryCast(e.OriginalSource, Control) - - If objControl IsNot Nothing AndAlso Not String.IsNullOrEmpty(objControl.Name) Then - strControlName = objControl.Name - End If - - Dim ex As Exception = e.Error.Exception - - While ex IsNot Nothing - Me.HostExceptions.Add(New ExceptionWrapper(e.Action, strControlName, e.Error.Exception)) - ex = ex.InnerException - End While - - End Sub - - Private Sub Application_UnhandledException(ByVal sender As Object, ByVal e As ApplicationUnhandledExceptionEventArgs) Handles _objApp.UnhandledException - Debug.WriteLine(String.Format("{0} had exception. {1}", Me.HostApplicationName, e.ExceptionObject.ToString)) - - Dim ex As Exception = e.ExceptionObject - - While ex IsNot Nothing - Me.HostExceptions.Add(New ExceptionWrapper(ex)) - ex = ex.InnerException - End While - - e.Handled = True - End Sub - -#End Region - -End Class
--- a/Glimpse/Glimpse.Old.vbproj Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,190 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'"> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> - </PropertyGroup> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>9.0.30729</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{C72D72F7-C49B-46DF-BD6C-0E14DBCD8F95}</ProjectGuid> - <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids> - <OutputType>Library</OutputType> - <RootNamespace>Glimpse</RootNamespace> - <AssemblyName>Glimpse</AssemblyName> - <TargetFrameworkVersion>v5.0</TargetFrameworkVersion> - <SilverlightApplication>false</SilverlightApplication> - <ValidateXaml>true</ValidateXaml> - <ThrowErrorsInValidation>true</ThrowErrorsInValidation> - <OptionExplicit>On</OptionExplicit> - <OptionCompare>Binary</OptionCompare> - <OptionStrict>On</OptionStrict> - <OptionInfer>On</OptionInfer> - <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier> - <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion> - <FileUpgradeFlags> - </FileUpgradeFlags> - <UpgradeBackupLocation> - </UpgradeBackupLocation> - <OldToolsVersion>4.0</OldToolsVersion> - <PublishUrl>publish\</PublishUrl> - <Install>true</Install> - <InstallFrom>Disk</InstallFrom> - <UpdateEnabled>false</UpdateEnabled> - <UpdateMode>Foreground</UpdateMode> - <UpdateInterval>7</UpdateInterval> - <UpdateIntervalUnits>Days</UpdateIntervalUnits> - <UpdatePeriodically>false</UpdatePeriodically> - <UpdateRequired>false</UpdateRequired> - <MapFileExtensions>true</MapFileExtensions> - <ApplicationRevision>0</ApplicationRevision> - <ApplicationVersion>1.0.0.%2a</ApplicationVersion> - <IsWebBootstrapper>false</IsWebBootstrapper> - <UseApplicationTrust>false</UseApplicationTrust> - <BootstrapperEnabled>true</BootstrapperEnabled> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <DefineDebug>true</DefineDebug> - <DefineTrace>true</DefineTrace> - <NoStdLib>true</NoStdLib> - <NoConfig>true</NoConfig> - <MyType>Empty</MyType> - <OutputPath>Bin\Debug</OutputPath> - <DocumentationFile>Glimpse.xml</DocumentationFile> - <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> - <DefineConstants>SILVERLIGHT=1</DefineConstants> - <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <DefineDebug>false</DefineDebug> - <DefineTrace>true</DefineTrace> - <NoStdLib>true</NoStdLib> - <NoConfig>true</NoConfig> - <Optimize>true</Optimize> - <OutputPath>Bin\Release</OutputPath> - <DocumentationFile>Glimpse.xml</DocumentationFile> - <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> - <DefineConstants>SILVERLIGHT=1</DefineConstants> - <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> - </PropertyGroup> - <ItemGroup> - <Reference Include="System.Windows" /> - <Reference Include="mscorlib" /> - <Reference Include="system" /> - <Reference Include="System.Core" /> - <Reference Include="System.Net" /> - <Reference Include="System.Windows.Controls, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> - <Reference Include="System.Xml" /> - <Reference Include="System.Windows.Browser" /> - </ItemGroup> - <ItemGroup> - <Import Include="Microsoft.VisualBasic" /> - <Import Include="System" /> - <Import Include="System.Linq" /> - <Import Include="System.Collections.Generic" /> - <Import Include="System.Net" /> - <Import Include="System.Xml" /> - <Import Include="System.Windows" /> - <Import Include="System.Windows.Controls" /> - <Import Include="System.Windows.Documents" /> - <Import Include="System.Windows.Ink" /> - <Import Include="System.Windows.Input" /> - <Import Include="System.Windows.Media" /> - <Import Include="System.Windows.Media.Animation" /> - <Import Include="System.Windows.Shapes" /> - </ItemGroup> - <ItemGroup> - <Compile Include="Glimpse Controls\BrokenBindingsViewer.xaml.vb"> - <DependentUpon>BrokenBindingsViewer.xaml</DependentUpon> - </Compile> - <Compile Include="Glimpse Controls\ExceptionsViewer.xaml.vb"> - <DependentUpon>ExceptionsViewer.xaml</DependentUpon> - </Compile> - <Compile Include="Glimpse Controls\LoadExceptionViewer.xaml.vb"> - <DependentUpon>LoadExceptionViewer.xaml</DependentUpon> - </Compile> - <Compile Include="Glimpse Controls\GlimpseViewer.xaml.vb"> - <DependentUpon>GlimpseViewer.xaml</DependentUpon> - </Compile> - <Compile Include="Glimpse Services\GlimpseService.vb" /> - <Compile Include="Model\BrokenBinding.vb" /> - <Compile Include="Model\ExceptionWrapper.vb" /> - <Compile Include="My Project\AssemblyInfo.vb" /> - </ItemGroup> - <ItemGroup> - <Page Include="Glimpse Controls\BrokenBindingsViewer.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:MarkupCompilePass1</Generator> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - <Page Include="Glimpse Controls\ExceptionsViewer.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:MarkupCompilePass1</Generator> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - <Page Include="Glimpse Controls\LoadExceptionViewer.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:MarkupCompilePass1</Generator> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - <Page Include="Glimpse Controls\GlimpseViewer.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:MarkupCompilePass1</Generator> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - </ItemGroup> - <ItemGroup> - <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> - <Visible>False</Visible> - <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> - <Install>false</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> - <Visible>False</Visible> - <ProductName>.NET Framework 3.5 SP1</ProductName> - <Install>true</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> - <Visible>False</Visible> - <ProductName>Windows Installer 3.1</ProductName> - <Install>true</Install> - </BootstrapperPackage> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\SilverlightGlimpse\FloatableWindow\FloatableWindow.csproj"> - <Project>{D47E6045-91BB-4CD0-942F-FF015F10F7F2}</Project> - <Name>FloatableWindow</Name> - </ProjectReference> - </ItemGroup> - <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.VisualBasic.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> - <ProjectExtensions> - <VisualStudio> - <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}"> - <SilverlightProjectProperties /> - </FlavorProperties> - </VisualStudio> - </ProjectExtensions> -</Project> \ No newline at end of file
--- a/Glimpse/Glimpse.Old.vbproj.user Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> - <PropertyGroup> - <PublishUrlHistory /> - <InstallUrlHistory /> - <SupportUrlHistory /> - <UpdateUrlHistory /> - <BootstrapperUrlHistory /> - <ErrorReportUrlHistory /> - <FallbackCulture>en-US</FallbackCulture> - <VerifyUploadedFiles>false</VerifyUploadedFiles> - </PropertyGroup> - <ProjectExtensions> - <VisualStudio> - <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}"> - <SilverlightProjectProperties> - <StartPageUrl> - </StartPageUrl> - <StartAction>DynamicPage</StartAction> - <AspNetDebugging>True</AspNetDebugging> - <NativeDebugging>False</NativeDebugging> - <SQLDebugging>False</SQLDebugging> - <ExternalProgram> - </ExternalProgram> - <StartExternalURL> - </StartExternalURL> - <StartCmdLineArguments> - </StartCmdLineArguments> - <StartWorkingDirectory> - </StartWorkingDirectory> - <ShowWebRefOnDebugPrompt>True</ShowWebRefOnDebugPrompt> - <OutOfBrowserProjectToDebug> - </OutOfBrowserProjectToDebug> - <ShowRiaSvcsOnDebugPrompt>True</ShowRiaSvcsOnDebugPrompt> - </SilverlightProjectProperties> - </FlavorProperties> - </VisualStudio> - </ProjectExtensions> -</Project> \ No newline at end of file
--- a/Glimpse/Glimpse.csi Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -[History] -1=#P0#=ce #P1#=ExceptionWrapper #P2#=ExceptionWrapper #P3#=ExceptionWrapper #P4#= #P5#=Glimpse|Model|ExceptionWrapper.vb #P6#=70 #P7#=20090608075630 #P8#=False #P9#=ExceptionWrapper [ExceptionWrapper, Glimpse\Model\ExceptionWrapper.vb] #P10#=0 . -2=#P0#=ce #P1#=BrokenBinding #P2#=BrokenBinding #P3#=BrokenBinding #P4#= #P5#=Glimpse|Model|BrokenBinding.vb #P6#=70 #P7#=20090608075554 #P8#=False #P9#=BrokenBinding [BrokenBinding, Glimpse\Model\BrokenBinding.vb] #P10#=2 .
--- a/Glimpse/Model/BrokenBinding.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ - -Public Class BrokenBinding - -#Region " Declarations " - - Private _strControlName As String = String.Empty - Private _strControlTypeName As String = String.Empty - Private _strPath As String = String.Empty - Private _strPropertyName As String = String.Empty - -#End Region - -#Region " Properties " - - Public ReadOnly Property ControlName() As String - Get - - If String.IsNullOrEmpty(_strControlName) Then - Return "(none)" - - Else - Return _strControlName - End If - - End Get - End Property - - Public ReadOnly Property ControlTypeName() As String - Get - Return _strControlTypeName - End Get - End Property - - Public ReadOnly Property Path() As String - Get - Return _strPath - End Get - End Property - - Public ReadOnly Property PropertyName() As String - Get - Return _strPropertyName - End Get - End Property - -#End Region - -#Region " Constructor " - - Public Sub New(ByVal strControlName As String, ByVal strControlTypeName As String, ByVal strPropertyName As String, ByVal strPath As String) - _strControlName = strControlName - _strControlTypeName = strControlTypeName - _strPropertyName = strPropertyName - _strPath = strPath - End Sub - -#End Region - -#Region " Methods " - - Public Overrides Function ToString() As String - Return String.Format("Control Name: {0}, Type: {1}, Property: {2}, Path: {3}", Me.ControlName, Me.ControlTypeName, Me.PropertyName, Me.Path) - End Function - -#End Region - -End Class
--- a/Glimpse/Model/ExceptionWrapper.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ - -Public Class ExceptionWrapper - -#Region " Declarations " - - Private _bolIsValidationException As Boolean = False - Private _enumAction As ValidationErrorEventAction = ValidationErrorEventAction.Added - Private _objException As Exception - Private _strControlName As String = String.Empty - -#End Region - -#Region " Properties " - - Public Sub New(ByVal enumAction As ValidationErrorEventAction, ByVal strControlName As String, ByVal objValidationException As Exception) - _enumAction = enumAction - _strControlName = strControlName - _objException = objValidationException - _bolIsValidationException = True - End Sub - - Public ReadOnly Property Action() As ValidationErrorEventAction - Get - Return _enumAction - End Get - End Property - - Public ReadOnly Property ControlName() As String - Get - Return _strControlName - End Get - End Property - - Public ReadOnly Property Exception() As Exception - Get - Return _objException - End Get - End Property - - Public ReadOnly Property IsValidationException() As Boolean - Get - Return _bolIsValidationException - End Get - End Property - -#End Region - -#Region " Constructor " - - Public Sub New(ByVal objException As Exception) - _objException = objException - End Sub - -#End Region - -#Region " Methods " - - Public Overrides Function ToString() As String - - If _bolIsValidationException Then - Return String.Format("({0}) - {1}", Me.Action, Exception.Message) - - Else - Return Exception.Message - End If - - End Function - -#End Region - -End Class
--- a/Glimpse/My Project/AssemblyInfo.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes -<Assembly: AssemblyTitle("Glimpse")> -<Assembly: AssemblyDescription("")> -<Assembly: AssemblyCompany("")> -<Assembly: AssemblyProduct("Glimpse")> -<Assembly: AssemblyCopyright("Copyright © 2009")> -<Assembly: AssemblyTrademark("")> - -<Assembly: ComVisible(False)> - -'The following GUID is for the ID of the typelib if this project is exposed to COM -<Assembly: Guid("6530da86-04ef-4d3d-88d7-d55e26263df0")> - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' <Assembly: AssemblyVersion("1.0.*")> - -<Assembly: AssemblyVersion("1.0.0.0")> -<Assembly: AssemblyFileVersion("1.0.0.0")>
Binary file SilverlightValidation/SilverlightValidation.Web/ClientBin/SilverlightValidation.xap has changed
--- a/delete me/Glimpse/Glimpse Controls/BrokenBindingsViewer.xaml Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -<UserControl x:Class="Glimpse.BrokenBindingsViewer" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> - <Grid x:Name="LayoutRoot" Background="White"> - <ScrollViewer> - <ItemsControl x:Name="icBrokenBindings" /> - </ScrollViewer> - </Grid> -</UserControl>
--- a/delete me/Glimpse/Glimpse Controls/BrokenBindingsViewer.xaml.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -Imports System.Reflection -Imports System.Windows.Data -Partial Public Class BrokenBindingsViewer - Inherits UserControl - - Public Sub New() - InitializeComponent() - End Sub - - Private Sub BrokenBindings_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded - Me.icBrokenBindings.Items.Clear() - LoadBrokenBindings(GlimpseService.CreateInstance.RootVisual) - End Sub - - Private Sub LoadBrokenBindings(ByVal uie As UIElement) - - Dim fwe As FrameworkElement = TryCast(uie, FrameworkElement) - - If fwe IsNot Nothing Then - - For Each fi As FieldInfo In fwe.GetType.GetFields(BindingFlags.Public Or BindingFlags.FlattenHierarchy Or BindingFlags.Instance Or BindingFlags.Static) - - If fi.FieldType Is GetType(DependencyProperty) Then - - Dim be As BindingExpression = fwe.GetBindingExpression(DirectCast(fi.GetValue(Nothing), DependencyProperty)) - - If be IsNot Nothing AndAlso be.ParentBinding.Source Is Nothing AndAlso be.ParentBinding.RelativeSource Is Nothing Then - - Dim bolIsInherited As Boolean = False - - If fwe.DataContext IsNot Nothing AndAlso Not String.IsNullOrEmpty(be.ParentBinding.Path.Path) Then - - For Each p As PropertyInfo In fwe.DataContext.GetType.GetProperties(BindingFlags.Public Or BindingFlags.FlattenHierarchy Or BindingFlags.Static Or BindingFlags.Instance) - - If String.Compare(p.Name, be.ParentBinding.Path.Path) = 0 Then - bolIsInherited = True - Exit For - End If - - Next - - End If - - If bolIsInherited Then - Exit For - End If - - '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 fwe.Name = "" AndAlso fwe.GetType.Name = "TextBlock" AndAlso fi.Name = "TextProperty" AndAlso be.ParentBinding.Path.Path = "" Then - Exit For - End If - - Dim objBrokenBinding As New BrokenBinding(fwe.Name, fwe.GetType.Name, fi.Name, be.ParentBinding.Path.Path) - Me.icBrokenBindings.Items.Add(objBrokenBinding) - System.Diagnostics.Debug.WriteLine(String.Format("Broken Binding - ", objBrokenBinding.ToString)) - End If - - End If - - Next - - Dim children As Integer = VisualTreeHelper.GetChildrenCount(fwe) - - For intX As Integer = 0 To children - 1 - - Dim child As FrameworkElement = TryCast(VisualTreeHelper.GetChild(fwe, intX), FrameworkElement) - - If child IsNot Nothing Then - LoadBrokenBindings(child) - End If - - Next - - End If - - End Sub - -End Class
--- a/delete me/Glimpse/Glimpse Controls/ExceptionsViewer.xaml Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -<UserControl - x:Class="Glimpse.ExceptionsViewer" - 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.ColumnDefinitions> - <ColumnDefinition Width="250" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="*" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - - <TextBlock Margin="3.5" Grid.ColumnSpan="2" FontSize="18" Foreground="Red" Text="Exceptions Viewer" VerticalAlignment="Center" /> - - <ListBox SelectionChanged="lbExceptions_SelectionChanged" ItemsSource="{Binding}" x:Name="lbExceptions" Margin="3.5" Grid.Row="1" /> - - <ScrollViewer DataContext="{Binding ElementName=lbExceptions, Path=SelectedItem}" Grid.Column="1" Grid.Row="1" Margin="3.5"> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - - <Rectangle Fill="BlanchedAlmond" /> - <TextBlock x:Name="tbAction" Text="Action" TextDecorations="Underline" FontSize="14" /> - <TextBlock Visibility="{Binding ElementName=tbAction, Path=Visibility}" Grid.Row="1" Text="{Binding Path=Action}" FontSize="11" TextWrapping="Wrap" /> - - <Rectangle Grid.Row="2" Fill="BlanchedAlmond" /> - <TextBlock Visibility="{Binding ElementName=tbAction, Path=Visibility}" Grid.Row="2" Text="Control Name" TextDecorations="Underline" Margin="0,7,0,0" FontSize="14" /> - <TextBlock Visibility="{Binding ElementName=tbAction, Path=Visibility}" Grid.Row="3" Text="{Binding Path=ControlName}" FontSize="11" TextWrapping="Wrap" /> - - <Rectangle Grid.Row="4" Fill="BlanchedAlmond" /> - <TextBlock Grid.Row="4" Text="Message" TextDecorations="Underline" FontSize="14" Margin="0,7,0,0" /> - <TextBlock Grid.Row="5" Text="{Binding Path=Exception.Message}" FontSize="11" TextWrapping="Wrap" /> - - <Rectangle Grid.Row="6" Fill="BlanchedAlmond" /> - <TextBlock Grid.Row="6" Text="Stack Trace" TextDecorations="Underline" FontSize="14" Margin="0,7,0,0" /> - <TextBlock Grid.Row="7" Text="{Binding Path=Exception.StackTrace}" FontSize="11" TextWrapping="Wrap" /> - - </Grid> - </ScrollViewer> - <Button Grid.Column="1" Grid.Row="2" Click="ClearExceptions_Click" Padding="7" Content="Clear Exceptions" Margin="11" HorizontalAlignment="Right" VerticalAlignment="Center" /> - </Grid> - -</UserControl>
--- a/delete me/Glimpse/Glimpse Controls/ExceptionsViewer.xaml.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -Partial Public Class ExceptionsViewer - Inherits UserControl - - Public Sub New() - InitializeComponent() - End Sub - - Private Sub ClearExceptions_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) - GlimpseService.CreateInstance.HostExceptions.Clear() - End Sub - - Private Sub ExceptionsViewer_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded - Me.DataContext = GlimpseService.CreateInstance.HostExceptions - If GlimpseService.CreateInstance.HostExceptions.Count > 0 Then - Me.lbExceptions.SelectedIndex = 0 - End If - End Sub - - Private Sub lbExceptions_SelectionChanged(ByVal sender As System.Object, ByVal e As System.Windows.Controls.SelectionChangedEventArgs) - - If Me.lbExceptions.SelectedItem IsNot Nothing AndAlso TypeOf Me.lbExceptions.SelectedItem Is ExceptionWrapper Then - - If DirectCast(Me.lbExceptions.SelectedItem, ExceptionWrapper).IsValidationException Then - Me.tbAction.Visibility = Windows.Visibility.Visible - - Else - Me.tbAction.Visibility = Windows.Visibility.Collapsed - End If - - End If - - End Sub - -End Class
--- a/delete me/Glimpse/Glimpse Controls/GlimpseViewer.xaml Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -<UserControl x:Class="Glimpse.GlimpseViewer" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="clr-namespace:Glimpse" - xmlns:swc="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"> - <Grid x:Name="LayoutRoot" Background="Khaki"> - <Grid.Resources> - <SolidColorBrush x:Name="noExceptionsBrush" Color="LightGreen" /> - <SolidColorBrush x:Name="hasExceptionsBrush" Color="Red" /> - </Grid.Resources> - <Grid x:Name="layoutInstrumentPanel"> - <StackPanel Orientation="Horizontal"> - <Grid Margin="7"> - <Ellipse x:Name="elpValidationExceptions" - Width="40" - Height="40" - Fill="LightGreen" - Stroke="Brown" - StrokeThickness="2" /> - <TextBlock x:Name="tbValidationExceptions" - HorizontalAlignment="Center" - VerticalAlignment="Center" - FontSize="12" - FontWeight="Bold" - Text="0" - ToolTipService.ToolTip="Binding Exception Count" /> - </Grid> - <Grid Margin="7"> - <Ellipse x:Name="elpUnhandledExceptions" - Width="40" - Height="40" - Fill="LightGreen" - Stroke="Brown" - StrokeThickness="2" /> - <TextBlock x:Name="tbUnhandledExceptions" - HorizontalAlignment="Center" - VerticalAlignment="Center" - FontSize="12" - FontWeight="Bold" - Text="0" - ToolTipService.ToolTip="Unhandled Exception Count" /> - </Grid> - <Button x:Name="btnExpand" - Margin="7" - VerticalAlignment="Center" - Content="Expand" /> - </StackPanel> - </Grid> - <Grid x:Name="layoutViewer" Visibility="Collapsed"> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="*" /> - </Grid.RowDefinitions> - <TextBlock Margin="3.5" - VerticalAlignment="Center" - FontSize="18" - Foreground="DarkGreen" - Text="Glimpse Viewer" /> - <Button x:Name="btnContract" - Margin="7" - HorizontalAlignment="Right" - VerticalAlignment="Center" - Content="Contract" /> - <swc:TabControl Grid.Row="1" - Width="690" - Height="390" - Background="Khaki" - SelectedIndex="2"> - <swc:TabItem Header="Exceptions"> - <local:ExceptionsViewer /> - </swc:TabItem> - <swc:TabItem Header="Bindings with no Source"> - <local:BrokenBindingsViewer /> - </swc:TabItem> - </swc:TabControl> - </Grid> - </Grid> - -</UserControl>
--- a/delete me/Glimpse/Glimpse Controls/GlimpseViewer.xaml.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -Partial Public Class GlimpseViewer - Inherits UserControl - - Public Sub New() - InitializeComponent() - Me.DataContext = GlimpseService.CreateInstance - AddHandler GlimpseService.CreateInstance.HostExceptions.CollectionChanged, AddressOf HostExceptions_CollectionChanged - End Sub - - Private Sub btnContract_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnContract.Click - Me.layoutViewer.Visibility = Windows.Visibility.Collapsed - End Sub - - Private Sub btnExpand_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnExpand.Click - Me.layoutViewer.Visibility = Windows.Visibility.Visible - End Sub - - Private Sub HostExceptions_CollectionChanged(ByVal sender As Object, ByVal e As System.Collections.Specialized.NotifyCollectionChangedEventArgs) - - Dim intUnhandledExceptionCount As Integer = 0 - Dim intValidationExceptionCount As Integer = 0 - - For Each ew As ExceptionWrapper In GlimpseService.CreateInstance.HostExceptions - - If ew.IsValidationException Then - intValidationExceptionCount += 1 - - Else - intUnhandledExceptionCount += 1 - End If - - Next - - Me.tbValidationExceptions.Text = intValidationExceptionCount.ToString - - If intValidationExceptionCount = 0 Then - Me.elpValidationExceptions.Fill = Me.noExceptionsBrush - - Else - Me.elpValidationExceptions.Fill = Me.hasExceptionsBrush - End If - - Me.tbUnhandledExceptions.Text = intUnhandledExceptionCount.ToString - - If intUnhandledExceptionCount = 0 Then - Me.elpUnhandledExceptions.Fill = Me.noExceptionsBrush - - Else - Me.elpUnhandledExceptions.Fill = Me.hasExceptionsBrush - End If - - End Sub - -End Class
--- a/delete me/Glimpse/Glimpse Controls/LoadExceptionViewer.xaml Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -<UserControl x:Class="Glimpse.LoadExceptionViewer" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> - <Border Height="375" Width="700" Margin="11" BorderBrush="Red" BorderThickness="2" Padding="11" Background="LightYellow" CornerRadius="20"> - <Grid x:Name="LayoutRoot"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="200" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="*" /> - </Grid.RowDefinitions> - <TextBlock Margin="3.5" Grid.ColumnSpan="2" FontSize="18" Foreground="Red" Text="Exception Viewer" VerticalAlignment="Center" /> - - <ListBox x:Name="lbExceptions" Margin="3.5" Grid.Row="1" DisplayMemberPath="Message" /> - - <TextBlock FontSize="14" Grid.ColumnSpan="2" x:Name="txtSourceLocation" VerticalAlignment="Center" HorizontalAlignment="Right" /> - <ScrollViewer Background="White" DataContext="{Binding ElementName=lbExceptions, Path=SelectedItem}" Grid.Column="1" Grid.Row="1" Margin="3.5"> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - <Rectangle Fill="BlanchedAlmond" /> - <TextBlock Text="Message" TextDecorations="Underline" FontSize="14" /> - <TextBlock Grid.Row="1" Text="{Binding Path=Message}" FontSize="11" TextWrapping="Wrap" /> - - <Rectangle Grid.Row="2" Fill="BlanchedAlmond" /> - <TextBlock Grid.Row="2" Text="Stack Trace" TextDecorations="Underline" FontSize="14" Margin="0,11,0,0" /> - <TextBlock Grid.Row="3" Text="{Binding Path=StackTrace}" FontSize="11" TextWrapping="Wrap" /> - - </Grid> - </ScrollViewer> - </Grid> - </Border> - -</UserControl>
--- a/delete me/Glimpse/Glimpse Controls/LoadExceptionViewer.xaml.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -Partial Public Class LoadExceptionViewer - Inherits UserControl - - Public Sub New() - InitializeComponent() - End Sub - - Public Sub New(ByVal e As Exception, ByVal strSourceLocation As String) - InitializeComponent() - Me.txtSourceLocation.Text = String.Concat("Source Location: ", strSourceLocation) - - Dim ex As Exception = e - - While ex IsNot Nothing - Me.lbExceptions.Items.Add(ex) - ex = ex.InnerException - End While - - If Me.lbExceptions.Items.Count > 0 Then - Me.lbExceptions.SelectedIndex = 0 - End If - - End Sub - -End Class
--- a/delete me/Glimpse/Glimpse Services/GlimpseService.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -Imports System.Diagnostics -Imports System.Collections.ObjectModel -Imports System.ComponentModel - -Public Class GlimpseService - -#Region " Declarations " - - Private Shared _instance As GlimpseService - Private _objGlimpseWindow As ChildWindow - Private _objHostExceptions As New ObservableCollection(Of ExceptionWrapper) - Private _strHostApplicationName As String = String.Empty - Private WithEvents _objApp As Application - Private WithEvents _objRootVisual As FrameworkElement - -#End Region - -#Region " Properties " - - Public Shared ReadOnly Property CreateInstance() As GlimpseService - Get - - If _instance Is Nothing Then - _instance = New GlimpseService - End If - - Return _instance - End Get - End Property - - Friend Property App() As Application - Get - Return _objApp - End Get - Set(ByVal Value As Application) - _objApp = Value - End Set - End Property - - Friend Property GlimpseWindow() As ChildWindow - Get - Return _objGlimpseWindow - End Get - - Private Set(ByVal Value As ChildWindow) - _objGlimpseWindow = Value - End Set - End Property - - Friend Property HostApplicationName() As String - Get - Return _strHostApplicationName - End Get - Set(ByVal Value As String) - _strHostApplicationName = Value - End Set - End Property - - Friend ReadOnly Property HostExceptions() As ObservableCollection(Of ExceptionWrapper) - Get - Return _objHostExceptions - End Get - End Property - - Friend Property RootVisual() As FrameworkElement - Get - Return _objRootVisual - End Get - Set(ByVal Value As FrameworkElement) - _objRootVisual = Value - End Set - End Property - -#End Region - -#Region " Creation and Loading " - - Public Sub DisplayLoadFailure(ByVal objApp As Application, ByVal ex As Exception, ByVal strHostApplicationName As String) - Debug.WriteLine(String.Format("{0} had exception. {1}", Me.HostApplicationName, ex.ToString)) - _objApp = objApp - _objApp.RootVisual = New LoadExceptionViewer(ex, strHostApplicationName) - End Sub - - Public Sub Load(ByVal objApp As Application, ByVal strHostApplicationName As String) - Me.App = objApp - Me.RootVisual = TryCast(objApp.RootVisual, FrameworkElement) - Me.HostApplicationName = strHostApplicationName - - Dim fw As New ChildWindow - fw.Title = Me.HostApplicationName - fw.Content = New GlimpseViewer - fw.Show() - - 'If Double.IsNaN(Me.RootVisual.Width) Then - ' 'if the host control is autosized (consumes the browser window) then locate Glimpse in the top, left - ' fw.Show() - 'Else - ' 'if the host is fixed size then attempt to locate the popup control in the upper right corner - ' Dim dblLeft As Double = Me.RootVisual.Width - 200 - - ' If dblLeft < 0 Then - ' dblLeft = 0 - ' End If - - ' fw.Show() - 'End If - - End Sub - - Private Sub New() - End Sub - -#End Region - -#Region " Host Application Events " - - Private Sub _objHostRootVisual_BindingValidationError(ByVal sender As Object, ByVal e As System.Windows.Controls.ValidationErrorEventArgs) Handles _objRootVisual.BindingValidationError - - Dim strControlName As String = "(none)" - Dim objControl As Control = TryCast(e.OriginalSource, Control) - - If objControl IsNot Nothing AndAlso Not String.IsNullOrEmpty(objControl.Name) Then - strControlName = objControl.Name - End If - - Dim ex As Exception = e.Error.Exception - - While ex IsNot Nothing - Me.HostExceptions.Add(New ExceptionWrapper(e.Action, strControlName, e.Error.Exception)) - ex = ex.InnerException - End While - - End Sub - - Private Sub Application_UnhandledException(ByVal sender As Object, ByVal e As ApplicationUnhandledExceptionEventArgs) Handles _objApp.UnhandledException - Debug.WriteLine(String.Format("{0} had exception. {1}", Me.HostApplicationName, e.ExceptionObject.ToString)) - - Dim ex As Exception = e.ExceptionObject - - While ex IsNot Nothing - Me.HostExceptions.Add(New ExceptionWrapper(ex)) - ex = ex.InnerException - End While - - e.Handled = True - End Sub - -#End Region - -End Class
--- a/delete me/Glimpse/Glimpse.csi Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -[History] -1=#P0#=ce #P1#=ExceptionWrapper #P2#=ExceptionWrapper #P3#=ExceptionWrapper #P4#= #P5#=Glimpse|Model|ExceptionWrapper.vb #P6#=70 #P7#=20090608075630 #P8#=False #P9#=ExceptionWrapper [ExceptionWrapper, Glimpse\Model\ExceptionWrapper.vb] #P10#=0 . -2=#P0#=ce #P1#=BrokenBinding #P2#=BrokenBinding #P3#=BrokenBinding #P4#= #P5#=Glimpse|Model|BrokenBinding.vb #P6#=70 #P7#=20090608075554 #P8#=False #P9#=BrokenBinding [BrokenBinding, Glimpse\Model\BrokenBinding.vb] #P10#=2 .
--- a/delete me/Glimpse/Glimpse.vbproj Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,179 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'"> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> - </PropertyGroup> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>9.0.30729</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{C72D72F7-C49B-46DF-BD6C-0E14DBCD8F95}</ProjectGuid> - <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids> - <OutputType>Library</OutputType> - <RootNamespace>Glimpse</RootNamespace> - <AssemblyName>Glimpse</AssemblyName> - <TargetFrameworkVersion>v3.0</TargetFrameworkVersion> - <SilverlightApplication>false</SilverlightApplication> - <ValidateXaml>true</ValidateXaml> - <ThrowErrorsInValidation>true</ThrowErrorsInValidation> - <OptionExplicit>On</OptionExplicit> - <OptionCompare>Binary</OptionCompare> - <OptionStrict>On</OptionStrict> - <OptionInfer>On</OptionInfer> - <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier> - <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion> - <FileUpgradeFlags> - </FileUpgradeFlags> - <UpgradeBackupLocation> - </UpgradeBackupLocation> - <OldToolsVersion>3.5</OldToolsVersion> - <PublishUrl>publish\</PublishUrl> - <Install>true</Install> - <InstallFrom>Disk</InstallFrom> - <UpdateEnabled>false</UpdateEnabled> - <UpdateMode>Foreground</UpdateMode> - <UpdateInterval>7</UpdateInterval> - <UpdateIntervalUnits>Days</UpdateIntervalUnits> - <UpdatePeriodically>false</UpdatePeriodically> - <UpdateRequired>false</UpdateRequired> - <MapFileExtensions>true</MapFileExtensions> - <ApplicationRevision>0</ApplicationRevision> - <ApplicationVersion>1.0.0.%2a</ApplicationVersion> - <IsWebBootstrapper>false</IsWebBootstrapper> - <UseApplicationTrust>false</UseApplicationTrust> - <BootstrapperEnabled>true</BootstrapperEnabled> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <DefineDebug>true</DefineDebug> - <DefineTrace>true</DefineTrace> - <NoStdLib>true</NoStdLib> - <NoConfig>true</NoConfig> - <MyType>Empty</MyType> - <OutputPath>Bin\Debug</OutputPath> - <DocumentationFile>Glimpse.xml</DocumentationFile> - <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> - <DefineConstants>SILVERLIGHT=1</DefineConstants> - <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <DefineDebug>false</DefineDebug> - <DefineTrace>true</DefineTrace> - <NoStdLib>true</NoStdLib> - <NoConfig>true</NoConfig> - <Optimize>true</Optimize> - <OutputPath>Bin\Release</OutputPath> - <DocumentationFile>Glimpse.xml</DocumentationFile> - <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> - <DefineConstants>SILVERLIGHT=1</DefineConstants> - <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> - </PropertyGroup> - <ItemGroup> - <Reference Include="FloatableWindow"> - <HintPath>..\Libs\FloatableWindow.dll</HintPath> - </Reference> - <Reference Include="System.Windows" /> - <Reference Include="mscorlib" /> - <Reference Include="system" /> - <Reference Include="System.Core" /> - <Reference Include="System.Net" /> - <Reference Include="System.Windows.Controls, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> - <Reference Include="System.Xml" /> - <Reference Include="System.Windows.Browser" /> - </ItemGroup> - <ItemGroup> - <Import Include="Microsoft.VisualBasic" /> - <Import Include="System" /> - <Import Include="System.Linq" /> - <Import Include="System.Collections.Generic" /> - <Import Include="System.Net" /> - <Import Include="System.Xml" /> - <Import Include="System.Windows" /> - <Import Include="System.Windows.Controls" /> - <Import Include="System.Windows.Documents" /> - <Import Include="System.Windows.Ink" /> - <Import Include="System.Windows.Input" /> - <Import Include="System.Windows.Media" /> - <Import Include="System.Windows.Media.Animation" /> - <Import Include="System.Windows.Shapes" /> - </ItemGroup> - <ItemGroup> - <Compile Include="Glimpse Controls\BrokenBindingsViewer.xaml.vb"> - <DependentUpon>BrokenBindingsViewer.xaml</DependentUpon> - </Compile> - <Compile Include="Glimpse Controls\ExceptionsViewer.xaml.vb"> - <DependentUpon>ExceptionsViewer.xaml</DependentUpon> - </Compile> - <Compile Include="Glimpse Controls\LoadExceptionViewer.xaml.vb"> - <DependentUpon>LoadExceptionViewer.xaml</DependentUpon> - </Compile> - <Compile Include="Glimpse Controls\GlimpseViewer.xaml.vb"> - <DependentUpon>GlimpseViewer.xaml</DependentUpon> - </Compile> - <Compile Include="Glimpse Services\GlimpseService.vb" /> - <Compile Include="Model\BrokenBinding.vb" /> - <Compile Include="Model\ExceptionWrapper.vb" /> - <Compile Include="My Project\AssemblyInfo.vb" /> - </ItemGroup> - <ItemGroup> - <Page Include="Glimpse Controls\BrokenBindingsViewer.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:MarkupCompilePass1</Generator> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - <Page Include="Glimpse Controls\ExceptionsViewer.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:MarkupCompilePass1</Generator> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - <Page Include="Glimpse Controls\LoadExceptionViewer.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:MarkupCompilePass1</Generator> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - <Page Include="Glimpse Controls\GlimpseViewer.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:MarkupCompilePass1</Generator> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - </ItemGroup> - <ItemGroup> - <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> - <Visible>False</Visible> - <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> - <Install>false</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> - <Visible>False</Visible> - <ProductName>.NET Framework 3.5 SP1</ProductName> - <Install>true</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> - <Visible>False</Visible> - <ProductName>Windows Installer 3.1</ProductName> - <Install>true</Install> - </BootstrapperPackage> - </ItemGroup> - <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.VisualBasic.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> - <ProjectExtensions> - <VisualStudio> - <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}"> - <SilverlightProjectProperties /> - </FlavorProperties> - </VisualStudio> - </ProjectExtensions> -</Project> \ No newline at end of file
--- a/delete me/Glimpse/Glimpse.vbproj.user Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> - <PropertyGroup> - <PublishUrlHistory /> - <InstallUrlHistory /> - <SupportUrlHistory /> - <UpdateUrlHistory /> - <BootstrapperUrlHistory /> - <ErrorReportUrlHistory /> - <FallbackCulture>en-US</FallbackCulture> - <VerifyUploadedFiles>false</VerifyUploadedFiles> - </PropertyGroup> - <ProjectExtensions> - <VisualStudio> - <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}"> - <SilverlightProjectProperties> - <StartPageUrl> - </StartPageUrl> - <StartAction>DynamicPage</StartAction> - <AspNetDebugging>True</AspNetDebugging> - <NativeDebugging>False</NativeDebugging> - <SQLDebugging>False</SQLDebugging> - <ExternalProgram> - </ExternalProgram> - <StartExternalURL> - </StartExternalURL> - <StartCmdLineArguments> - </StartCmdLineArguments> - <StartWorkingDirectory> - </StartWorkingDirectory> - <ShowWebRefOnDebugPrompt>True</ShowWebRefOnDebugPrompt> - <OutOfBrowserProjectToDebug> - </OutOfBrowserProjectToDebug> - <ShowRiaSvcsOnDebugPrompt>True</ShowRiaSvcsOnDebugPrompt> - </SilverlightProjectProperties> - </FlavorProperties> - </VisualStudio> - </ProjectExtensions> -</Project> \ No newline at end of file
--- a/delete me/Glimpse/Model/BrokenBinding.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ - -Public Class BrokenBinding - -#Region " Declarations " - - Private _strControlName As String = String.Empty - Private _strControlTypeName As String = String.Empty - Private _strPath As String = String.Empty - Private _strPropertyName As String = String.Empty - -#End Region - -#Region " Properties " - - Public ReadOnly Property ControlName() As String - Get - - If String.IsNullOrEmpty(_strControlName) Then - Return "(none)" - - Else - Return _strControlName - End If - - End Get - End Property - - Public ReadOnly Property ControlTypeName() As String - Get - Return _strControlTypeName - End Get - End Property - - Public ReadOnly Property Path() As String - Get - Return _strPath - End Get - End Property - - Public ReadOnly Property PropertyName() As String - Get - Return _strPropertyName - End Get - End Property - -#End Region - -#Region " Constructor " - - Public Sub New(ByVal strControlName As String, ByVal strControlTypeName As String, ByVal strPropertyName As String, ByVal strPath As String) - _strControlName = strControlName - _strControlTypeName = strControlTypeName - _strPropertyName = strPropertyName - _strPath = strPath - End Sub - -#End Region - -#Region " Methods " - - Public Overrides Function ToString() As String - Return String.Format("Control Name: {0}, Type: {1}, Property: {2}, Path: {3}", Me.ControlName, Me.ControlTypeName, Me.PropertyName, Me.Path) - End Function - -#End Region - -End Class
--- a/delete me/Glimpse/Model/ExceptionWrapper.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ - -Public Class ExceptionWrapper - -#Region " Declarations " - - Private _bolIsValidationException As Boolean = False - Private _enumAction As ValidationErrorEventAction = ValidationErrorEventAction.Added - Private _objException As Exception - Private _strControlName As String = String.Empty - -#End Region - -#Region " Properties " - - Public Sub New(ByVal enumAction As ValidationErrorEventAction, ByVal strControlName As String, ByVal objValidationException As Exception) - _enumAction = enumAction - _strControlName = strControlName - _objException = objValidationException - _bolIsValidationException = True - End Sub - - Public ReadOnly Property Action() As ValidationErrorEventAction - Get - Return _enumAction - End Get - End Property - - Public ReadOnly Property ControlName() As String - Get - Return _strControlName - End Get - End Property - - Public ReadOnly Property Exception() As Exception - Get - Return _objException - End Get - End Property - - Public ReadOnly Property IsValidationException() As Boolean - Get - Return _bolIsValidationException - End Get - End Property - -#End Region - -#Region " Constructor " - - Public Sub New(ByVal objException As Exception) - _objException = objException - End Sub - -#End Region - -#Region " Methods " - - Public Overrides Function ToString() As String - - If _bolIsValidationException Then - Return String.Format("({0}) - {1}", Me.Action, Exception.Message) - - Else - Return Exception.Message - End If - - End Function - -#End Region - -End Class
--- a/delete me/Glimpse/My Project/AssemblyInfo.vb Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes -<Assembly: AssemblyTitle("Glimpse")> -<Assembly: AssemblyDescription("")> -<Assembly: AssemblyCompany("")> -<Assembly: AssemblyProduct("Glimpse")> -<Assembly: AssemblyCopyright("Copyright © 2009")> -<Assembly: AssemblyTrademark("")> - -<Assembly: ComVisible(False)> - -'The following GUID is for the ID of the typelib if this project is exposed to COM -<Assembly: Guid("6530da86-04ef-4d3d-88d7-d55e26263df0")> - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' <Assembly: AssemblyVersion("1.0.*")> - -<Assembly: AssemblyVersion("1.0.0.0")> -<Assembly: AssemblyFileVersion("1.0.0.0")>
--- a/delete me/SilverlightValidation.Web/Properties/AssemblyInfo.cs Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SilverlightValidation.Web")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SilverlightValidation.Web")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("703e13c4-4206-4f77-94e3-ad7035029799")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")]
--- a/delete me/SilverlightValidation.Web/Silverlight.js Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -//v2.0.30511.0 -if(!window.Silverlight)window.Silverlight={};Silverlight._silverlightCount=0;Silverlight.__onSilverlightInstalledCalled=false;Silverlight.fwlinkRoot="http://go2.microsoft.com/fwlink/?LinkID=";Silverlight.__installationEventFired=false;Silverlight.onGetSilverlight=null;Silverlight.onSilverlightInstalled=function(){window.location.reload(false)};Silverlight.isInstalled=function(b){if(b==undefined)b=null;var a=false,m=null;try{var i=null,j=false;if(window.ActiveXObject)try{i=new ActiveXObject("AgControl.AgControl");if(b===null)a=true;else if(i.IsVersionSupported(b))a=true;i=null}catch(l){j=true}else j=true;if(j){var k=navigator.plugins["Silverlight Plug-In"];if(k)if(b===null)a=true;else{var h=k.description;if(h==="1.0.30226.2")h="2.0.30226.2";var c=h.split(".");while(c.length>3)c.pop();while(c.length<4)c.push(0);var e=b.split(".");while(e.length>4)e.pop();var d,g,f=0;do{d=parseInt(e[f]);g=parseInt(c[f]);f++}while(f<e.length&&d===g);if(d<=g&&!isNaN(d))a=true}}}catch(l){a=false}return a};Silverlight.WaitForInstallCompletion=function(){if(!Silverlight.isBrowserRestartRequired&&Silverlight.onSilverlightInstalled){try{navigator.plugins.refresh()}catch(a){}if(Silverlight.isInstalled(null)&&!Silverlight.__onSilverlightInstalledCalled){Silverlight.onSilverlightInstalled();Silverlight.__onSilverlightInstalledCalled=true}else setTimeout(Silverlight.WaitForInstallCompletion,3e3)}};Silverlight.__startup=function(){navigator.plugins.refresh();Silverlight.isBrowserRestartRequired=Silverlight.isInstalled(null);if(!Silverlight.isBrowserRestartRequired){Silverlight.WaitForInstallCompletion();if(!Silverlight.__installationEventFired){Silverlight.onInstallRequired();Silverlight.__installationEventFired=true}}else if(window.navigator.mimeTypes){var b=navigator.mimeTypes["application/x-silverlight-2"],c=navigator.mimeTypes["application/x-silverlight-2-b2"],d=navigator.mimeTypes["application/x-silverlight-2-b1"],a=d;if(c)a=c;if(!b&&(d||c)){if(!Silverlight.__installationEventFired){Silverlight.onUpgradeRequired();Silverlight.__installationEventFired=true}}else if(b&&a)if(b.enabledPlugin&&a.enabledPlugin)if(b.enabledPlugin.description!=a.enabledPlugin.description)if(!Silverlight.__installationEventFired){Silverlight.onRestartRequired();Silverlight.__installationEventFired=true}}if(!Silverlight.disableAutoStartup)if(window.removeEventListener)window.removeEventListener("load",Silverlight.__startup,false);else window.detachEvent("onload",Silverlight.__startup)};if(!Silverlight.disableAutoStartup)if(window.addEventListener)window.addEventListener("load",Silverlight.__startup,false);else window.attachEvent("onload",Silverlight.__startup);Silverlight.createObject=function(m,f,e,k,l,h,j){var d={},a=k,c=l;d.version=a.version;a.source=m;d.alt=a.alt;if(h)a.initParams=h;if(a.isWindowless&&!a.windowless)a.windowless=a.isWindowless;if(a.framerate&&!a.maxFramerate)a.maxFramerate=a.framerate;if(e&&!a.id)a.id=e;delete a.ignoreBrowserVer;delete a.inplaceInstallPrompt;delete a.version;delete a.isWindowless;delete a.framerate;delete a.data;delete a.src;delete a.alt;if(Silverlight.isInstalled(d.version)){for(var b in c)if(c[b]){if(b=="onLoad"&&typeof c[b]=="function"&&c[b].length!=1){var i=c[b];c[b]=function(a){return i(document.getElementById(e),j,a)}}var g=Silverlight.__getHandlerName(c[b]);if(g!=null){a[b]=g;c[b]=null}else throw"typeof events."+b+" must be 'function' or 'string'";}slPluginHTML=Silverlight.buildHTML(a)}else slPluginHTML=Silverlight.buildPromptHTML(d);if(f)f.innerHTML=slPluginHTML;else return slPluginHTML};Silverlight.buildHTML=function(a){var b=[];b.push('<object type="application/x-silverlight" data="data:application/x-silverlight,"');if(a.id!=null)b.push(' id="'+Silverlight.HtmlAttributeEncode(a.id)+'"');if(a.width!=null)b.push(' width="'+a.width+'"');if(a.height!=null)b.push(' height="'+a.height+'"');b.push(" >");delete a.id;delete a.width;delete a.height;for(var c in a)if(a[c])b.push('<param name="'+Silverlight.HtmlAttributeEncode(c)+'" value="'+Silverlight.HtmlAttributeEncode(a[c])+'" />');b.push("</object>");return b.join("")};Silverlight.createObjectEx=function(b){var a=b,c=Silverlight.createObject(a.source,a.parentElement,a.id,a.properties,a.events,a.initParams,a.context);if(a.parentElement==null)return c};Silverlight.buildPromptHTML=function(b){var a="",d=Silverlight.fwlinkRoot,c=b.version;if(b.alt)a=b.alt;else{if(!c)c="";a="<a href='javascript:Silverlight.getSilverlight(\"{1}\");' style='text-decoration: none;'><img src='{2}' alt='Get Microsoft Silverlight' style='border-style: none'/></a>";a=a.replace("{1}",c);a=a.replace("{2}",d+"108181")}return a};Silverlight.getSilverlight=function(e){if(Silverlight.onGetSilverlight)Silverlight.onGetSilverlight();var b="",a=String(e).split(".");if(a.length>1){var c=parseInt(a[0]);if(isNaN(c)||c<2)b="1.0";else b=a[0]+"."+a[1]}var d="";if(b.match(/^\d+\056\d+$/))d="&v="+b;Silverlight.followFWLink("149156"+d)};Silverlight.followFWLink=function(a){top.location=Silverlight.fwlinkRoot+String(a)};Silverlight.HtmlAttributeEncode=function(c){var a,b="";if(c==null)return null;for(var d=0;d<c.length;d++){a=c.charCodeAt(d);if(a>96&&a<123||a>64&&a<91||a>43&&a<58&&a!=47||a==95)b=b+String.fromCharCode(a);else b=b+"&#"+a+";"}return b};Silverlight.default_error_handler=function(e,b){var d,c=b.ErrorType;d=b.ErrorCode;var a="\nSilverlight error message \n";a+="ErrorCode: "+d+"\n";a+="ErrorType: "+c+" \n";a+="Message: "+b.ErrorMessage+" \n";if(c=="ParserError"){a+="XamlFile: "+b.xamlFile+" \n";a+="Line: "+b.lineNumber+" \n";a+="Position: "+b.charPosition+" \n"}else if(c=="RuntimeError"){if(b.lineNumber!=0){a+="Line: "+b.lineNumber+" \n";a+="Position: "+b.charPosition+" \n"}a+="MethodName: "+b.methodName+" \n"}alert(a)};Silverlight.__cleanup=function(){for(var a=Silverlight._silverlightCount-1;a>=0;a--)window["__slEvent"+a]=null;Silverlight._silverlightCount=0;if(window.removeEventListener)window.removeEventListener("unload",Silverlight.__cleanup,false);else window.detachEvent("onunload",Silverlight.__cleanup)};Silverlight.__getHandlerName=function(b){var a="";if(typeof b=="string")a=b;else if(typeof b=="function"){if(Silverlight._silverlightCount==0)if(window.addEventListener)window.addEventListener("onunload",Silverlight.__cleanup,false);else window.attachEvent("onunload",Silverlight.__cleanup);var c=Silverlight._silverlightCount++;a="__slEvent"+c;window[a]=b}else a=null;return a};Silverlight.onRequiredVersionAvailable=function(){};Silverlight.onRestartRequired=function(){};Silverlight.onUpgradeRequired=function(){};Silverlight.onInstallRequired=function(){};Silverlight.IsVersionAvailableOnError=function(d,a){var b=false;try{if(a.ErrorCode==8001&&!Silverlight.__installationEventFired){Silverlight.onUpgradeRequired();Silverlight.__installationEventFired=true}else if(a.ErrorCode==8002&&!Silverlight.__installationEventFired){Silverlight.onRestartRequired();Silverlight.__installationEventFired=true}else if(a.ErrorCode==5014||a.ErrorCode==2106){if(Silverlight.__verifySilverlight2UpgradeSuccess(a.getHost()))b=true}else b=true}catch(c){}return b};Silverlight.IsVersionAvailableOnLoad=function(b){var a=false;try{if(Silverlight.__verifySilverlight2UpgradeSuccess(b.getHost()))a=true}catch(c){}return a};Silverlight.__verifySilverlight2UpgradeSuccess=function(d){var c=false,b="2.0.31005",a=null;try{if(d.IsVersionSupported(b+".99")){a=Silverlight.onRequiredVersionAvailable;c=true}else if(d.IsVersionSupported(b+".0"))a=Silverlight.onRestartRequired;else a=Silverlight.onUpgradeRequired;if(a&&!Silverlight.__installationEventFired){a();Silverlight.__installationEventFired=true}}catch(e){}return c} \ No newline at end of file
--- a/delete me/SilverlightValidation.Web/SilverlightValidation.Web.csproj Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion> - </ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{E65C6757-932B-4D01-9A8A-6D02F8FAA25A}</ProjectGuid> - <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>SilverlightValidation.Web</RootNamespace> - <AssemblyName>SilverlightValidation.Web</AssemblyName> - <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> - <UseIISExpress>false</UseIISExpress> - <SilverlightApplicationList>{0C1CC1FC-915A-4428-8952-CDC79EABC3F4}|..\SilverlightValidation\SilverlightValidation.csproj|ClientBin|False</SilverlightApplicationList> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="Microsoft.CSharp" /> - <Reference Include="System.Web.DynamicData" /> - <Reference Include="System.Web.Entity" /> - <Reference Include="System.Web.ApplicationServices" /> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Core" /> - <Reference Include="System.Data.DataSetExtensions" /> - <Reference Include="System.Web.Extensions" /> - <Reference Include="System.Xml.Linq" /> - <Reference Include="System.Drawing" /> - <Reference Include="System.Web" /> - <Reference Include="System.Xml" /> - <Reference Include="System.Configuration" /> - <Reference Include="System.Web.Services" /> - <Reference Include="System.EnterpriseServices" /> - </ItemGroup> - <ItemGroup> - <Content Include="ClientBin\SilverlightValidation.xap" /> - <Content Include="Silverlight.js" /> - <Content Include="index.html" /> - <Content Include="Web.config" /> - <Content Include="Web.Debug.config"> - <DependentUpon>Web.config</DependentUpon> - </Content> - <Content Include="Web.Release.config"> - <DependentUpon>Web.config</DependentUpon> - </Content> - </ItemGroup> - <ItemGroup> - <Compile Include="Properties\AssemblyInfo.cs" /> - </ItemGroup> - <ItemGroup /> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> - <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> - <ProjectExtensions> - <VisualStudio> - <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> - <WebProjectProperties> - <UseIIS>False</UseIIS> - <AutoAssignPort>True</AutoAssignPort> - <DevelopmentServerPort>50940</DevelopmentServerPort> - <DevelopmentServerVPath>/</DevelopmentServerVPath> - <IISUrl> - </IISUrl> - <NTLMAuthentication>False</NTLMAuthentication> - <UseCustomServer>False</UseCustomServer> - <CustomServerUrl> - </CustomServerUrl> - <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> - </WebProjectProperties> - </FlavorProperties> - </VisualStudio> - </ProjectExtensions> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> -</Project> \ No newline at end of file
--- a/delete me/SilverlightValidation.Web/Web.Debug.config Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -<?xml version="1.0"?> - -<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 --> - -<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> - <!-- - In the example below, the "SetAttributes" transform will change the value of - "connectionString" to use "ReleaseSQLServer" only when the "Match" locator - finds an atrribute "name" that has a value of "MyDB". - - <connectionStrings> - <add name="MyDB" - connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" - xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> - </connectionStrings> - --> - <system.web> - <!-- - In the example below, the "Replace" transform will replace the entire - <customErrors> section of your web.config file. - Note that because there is only one customErrors section under the - <system.web> node, there is no need to use the "xdt:Locator" attribute. - - <customErrors defaultRedirect="GenericError.htm" - mode="RemoteOnly" xdt:Transform="Replace"> - <error statusCode="500" redirect="InternalError.htm"/> - </customErrors> - --> - </system.web> -</configuration> \ No newline at end of file
--- a/delete me/SilverlightValidation.Web/Web.Release.config Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -<?xml version="1.0"?> - -<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 --> - -<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> - <!-- - In the example below, the "SetAttributes" transform will change the value of - "connectionString" to use "ReleaseSQLServer" only when the "Match" locator - finds an atrribute "name" that has a value of "MyDB". - - <connectionStrings> - <add name="MyDB" - connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" - xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> - </connectionStrings> - --> - <system.web> - <compilation xdt:Transform="RemoveAttributes(debug)" /> - <!-- - In the example below, the "Replace" transform will replace the entire - <customErrors> section of your web.config file. - Note that because there is only one customErrors section under the - <system.web> node, there is no need to use the "xdt:Locator" attribute. - - <customErrors defaultRedirect="GenericError.htm" - mode="RemoteOnly" xdt:Transform="Replace"> - <error statusCode="500" redirect="InternalError.htm"/> - </customErrors> - --> - </system.web> -</configuration> \ No newline at end of file
--- a/delete me/SilverlightValidation.Web/Web.config Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -<?xml version="1.0"?> - -<!-- - For more information on how to configure your ASP.NET application, please visit - http://go.microsoft.com/fwlink/?LinkId=169433 - --> - -<configuration> - <system.web> - <compilation debug="true" targetFramework="4.0" /> - </system.web> - -</configuration>
--- a/delete me/SilverlightValidation.Web/index.html Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" > - -<head> - <title>SilverlightValidation</title> - <style type="text/css"> - html, body { - height: 100%; - overflow: auto; - } - body { - padding: 0; - margin: 0; - } - #silverlightControlHost { - height: 100%; - text-align:center; - } - </style> - <script type="text/javascript" src="Silverlight.js"></script> - <script type="text/javascript"> - function onSilverlightError(sender, args) { - var appSource = ""; - if (sender != null && sender != 0) { - appSource = sender.getHost().Source; - } - - var errorType = args.ErrorType; - var iErrorCode = args.ErrorCode; - - if (errorType == "ImageError" || errorType == "MediaError") { - return; - } - - var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n" ; - - errMsg += "Code: "+ iErrorCode + " \n"; - errMsg += "Category: " + errorType + " \n"; - errMsg += "Message: " + args.ErrorMessage + " \n"; - - if (errorType == "ParserError") { - errMsg += "File: " + args.xamlFile + " \n"; - errMsg += "Line: " + args.lineNumber + " \n"; - errMsg += "Position: " + args.charPosition + " \n"; - } - else if (errorType == "RuntimeError") { - if (args.lineNumber != 0) { - errMsg += "Line: " + args.lineNumber + " \n"; - errMsg += "Position: " + args.charPosition + " \n"; - } - errMsg += "MethodName: " + args.methodName + " \n"; - } - - throw new Error(errMsg); - } - </script> -</head> -<body> - <form id="form1" runat="server" style="height:100%"> - <div id="silverlightControlHost"> - <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"> - <param name="source" value="ClientBin/SilverlightValidation.xap"/> - <param name="onError" value="onSilverlightError" /> - <param name="background" value="white" /> - <param name="minRuntimeVersion" value="5.0.61118.0" /> - <param name="autoUpgrade" value="true" /> - <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=5.0.61118.0" style="text-decoration:none"> - <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/> - </a> - </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div> - </form> -</body> -</html>
--- a/delete me/SilverlightValidation.sln Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SilverlightValidation", "SilverlightValidation\SilverlightValidation.csproj", "{0C1CC1FC-915A-4428-8952-CDC79EABC3F4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SilverlightValidation.Web", "SilverlightValidation.Web\SilverlightValidation.Web.csproj", "{E65C6757-932B-4D01-9A8A-6D02F8FAA25A}" -EndProject -Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Glimpse", "Glimpse\Glimpse.vbproj", "{C72D72F7-C49B-46DF-BD6C-0E14DBCD8F95}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {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 - {E65C6757-932B-4D01-9A8A-6D02F8FAA25A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E65C6757-932B-4D01-9A8A-6D02F8FAA25A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E65C6757-932B-4D01-9A8A-6D02F8FAA25A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E65C6757-932B-4D01-9A8A-6D02F8FAA25A}.Release|Any CPU.Build.0 = Release|Any CPU - {C72D72F7-C49B-46DF-BD6C-0E14DBCD8F95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C72D72F7-C49B-46DF-BD6C-0E14DBCD8F95}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C72D72F7-C49B-46DF-BD6C-0E14DBCD8F95}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C72D72F7-C49B-46DF-BD6C-0E14DBCD8F95}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal
--- a/delete me/SilverlightValidation/App.xaml Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,997 +0,0 @@ -<Application x:Class="SilverlightValidation.App" - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:p="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls" - xmlns:s="clr-namespace:System;assembly=mscorlib" - xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"> - <Application.Resources> - <ControlTemplate x:Key="ValidationToolTipTemplate"> - <Grid x:Name="Root" - Margin="5,0" - Opacity="0" - RenderTransformOrigin="0,0"> - <Grid.RenderTransform> - <TranslateTransform x:Name="xform" X="-25" /> - </Grid.RenderTransform> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="OpenStates"> - <VisualStateGroup.Transitions> - <VisualTransition GeneratedDuration="0" /> - <VisualTransition GeneratedDuration="0:0:0.2" To="Open"> - <Storyboard> - <DoubleAnimation Duration="0:0:0.2" - Storyboard.TargetName="xform" - Storyboard.TargetProperty="X" - To="0"> - <DoubleAnimation.EasingFunction> - <BackEase Amplitude=".3" EasingMode="EaseOut" /> - </DoubleAnimation.EasingFunction> - </DoubleAnimation> - <DoubleAnimation Duration="0:0:0.2" - Storyboard.TargetName="Root" - Storyboard.TargetProperty="Opacity" - To="1" /> - </Storyboard> - </VisualTransition> - </VisualStateGroup.Transitions> - <VisualState x:Name="Closed"> - <Storyboard> - <DoubleAnimation Duration="0" - Storyboard.TargetName="Root" - Storyboard.TargetProperty="Opacity" - To="0" /> - </Storyboard> - </VisualState> - <VisualState x:Name="Open"> - <Storyboard> - <DoubleAnimation Duration="0" - Storyboard.TargetName="xform" - Storyboard.TargetProperty="X" - To="0" /> - <DoubleAnimation Duration="0" - Storyboard.TargetName="Root" - Storyboard.TargetProperty="Opacity" - To="1" /> - </Storyboard> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - <Border Margin="4,4,-4,-4" - Background="#052A2E31" - CornerRadius="5" /> - <Border Margin="3,3,-3,-3" - Background="#152A2E31" - CornerRadius="4" /> - <Border Margin="2,2,-2,-2" - Background="#252A2E31" - CornerRadius="3" /> - <Border Margin="1,1,-1,-1" - Background="#352A2E31" - CornerRadius="2" /> - <Border Background="#FFF3AB00" CornerRadius="2" /> - <Border CornerRadius="2"> - <TextBlock MaxWidth="250" - Margin="8,4,8,4" - Foreground="White" - Text="{Binding (Validation.Errors)[0].ErrorContent}" - TextWrapping="Wrap" - UseLayoutRounding="false" /> - </Border> - </Grid> - </ControlTemplate> - - <Style x:Key="LabelStyle" TargetType="TextBlock"> - <Setter Property="Height" Value="18" /> - <Setter Property="FontFamily" Value="Segoe UI Light" /> - <Setter Property="FontSize" Value="14" /> - <Setter Property="VerticalAlignment" Value="Center" /> - </Style> - - <Style x:Key="TextBoxStyle" TargetType="TextBox"> - <Setter Property="BorderThickness" Value="1" /> - <Setter Property="Background" Value="#FFFFFFFF" /> - <Setter Property="FontFamily" Value="Segoe UI Light" /> - <Setter Property="FontSize" Value="12" /> - <Setter Property="Height" Value="24" /> - <Setter Property="VerticalAlignment" Value="Center" /> - <Setter Property="Foreground" Value="#FF000000" /> - <Setter Property="Padding" Value="2" /> - <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="TextBox"> - <Grid x:Name="RootElement"> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal" /> - <VisualState x:Name="MouseOver"> - <Storyboard> - <ColorAnimation Duration="0" - Storyboard.TargetName="MouseOverBorder" - Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" - To="#FF99C1E2" /> - </Storyboard> - </VisualState> - <VisualState x:Name="Disabled"> - <Storyboard> - <DoubleAnimation Duration="0" - Storyboard.TargetName="DisabledVisualElement" - Storyboard.TargetProperty="Opacity" - To="1" /> - </Storyboard> - </VisualState> - <VisualState x:Name="ReadOnly"> - <Storyboard> - <DoubleAnimation Duration="0" - Storyboard.TargetName="ReadOnlyVisualElement" - Storyboard.TargetProperty="Opacity" - To="1" /> - </Storyboard> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="FocusStates"> - <VisualState x:Name="Focused"> - <Storyboard> - <DoubleAnimation Duration="0" - Storyboard.TargetName="FocusVisualElement" - Storyboard.TargetProperty="Opacity" - To="1" /> - </Storyboard> - </VisualState> - <VisualState x:Name="Unfocused"> - <Storyboard> - <DoubleAnimation Duration="0" - Storyboard.TargetName="FocusVisualElement" - Storyboard.TargetProperty="Opacity" - To="0" /> - </Storyboard> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="ValidationStates"> - <VisualState x:Name="Valid" /> - <VisualState x:Name="InvalidUnfocused"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <Visibility>Visible</Visibility> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="InvalidFocused"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <Visibility>Visible</Visibility> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <s:Boolean>True</s:Boolean> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - <Border x:Name="Border" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="1" - Opacity="1"> - <Grid> - <Border x:Name="ReadOnlyVisualElement" - Background="#5EC9C9C9" - Opacity="0" /> - <Border x:Name="MouseOverBorder" - BorderBrush="Transparent" - BorderThickness="1"> - <ScrollViewer x:Name="ContentElement" - BorderThickness="0" - IsTabStop="False" - Padding="{TemplateBinding Padding}" /> - </Border> - </Grid> - </Border> - <Border x:Name="DisabledVisualElement" - Background="#A5F7F7F7" - BorderBrush="#A5F7F7F7" - BorderThickness="{TemplateBinding BorderThickness}" - IsHitTestVisible="False" - Opacity="0" /> - <Border x:Name="FocusVisualElement" - Margin="1" - BorderBrush="#FF6DBDD1" - BorderThickness="{TemplateBinding BorderThickness}" - IsHitTestVisible="False" - Opacity="0" /> - <Border x:Name="ValidationErrorElement" - BorderBrush="#FFF3AB00" - BorderThickness="1" - CornerRadius="1" - Visibility="Collapsed"> - <ToolTipService.ToolTip> - <ToolTip x:Name="validationTooltip" - DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" - Placement="Right" - PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" - Template="{StaticResource ValidationToolTipTemplate}"> - <ToolTip.Triggers> - <EventTrigger RoutedEvent="Canvas.Loaded"> - <EventTrigger.Actions> - <BeginStoryboard> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <s:Boolean>true</s:Boolean> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </BeginStoryboard> - </EventTrigger.Actions> - </EventTrigger> - </ToolTip.Triggers> - </ToolTip> - </ToolTipService.ToolTip> - <Grid Width="12" - Height="12" - Margin="1,-4,-4,0" - HorizontalAlignment="Right" - VerticalAlignment="Top" - Background="Transparent"> - <Path Margin="1,3,0,0" - Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z" - Fill="#FFF3AB00" /> - <Path Margin="1,3,0,0" - Data="M 0,0 L2,0 L 8,6 L8,8" - Fill="#ffffff" /> - </Grid> - </Border> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - - <Style x:Key="DatePickerStyle" TargetType="sdk:DatePicker"> - <Setter Property="FontFamily" Value="Segoe UI Light" /> - <Setter Property="FontSize" Value="14" /> - <Setter Property="Height" Value="24" /> - <Setter Property="VerticalAlignment" Value="Center" /> - <Setter Property="IsTabStop" Value="False" /> - <Setter Property="Background" Value="#FFFFFFFF" /> - <Setter Property="Padding" Value="2" /> - <Setter Property="SelectionBackground" Value="#FF444444" /> - <Setter Property="BorderBrush"> - <Setter.Value> - <LinearGradientBrush StartPoint=".5,1" EndPoint=".5,0"> - <GradientStop Offset="0" Color="#FF617584" /> - <GradientStop Offset="0.375" Color="#FF718597" /> - <GradientStop Offset="0.375" Color="#FF8399A9" /> - <GradientStop Offset="1" Color="#FFA3AEB9" /> - </LinearGradientBrush> - </Setter.Value> - </Setter> - <Setter Property="BorderThickness" Value="1" /> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="sdk:DatePicker"> - <Grid x:Name="Root"> - <Grid.Resources> - <SolidColorBrush x:Key="DisabledBrush" Color="#8CFFFFFF" /> - <ControlTemplate x:Key="DropDownButtonTemplate" TargetType="Button"> - <Grid> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualStateGroup.Transitions> - <VisualTransition GeneratedDuration="0" /> - <VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver" /> - <VisualTransition GeneratedDuration="0:0:0.1" To="Pressed" /> - </VisualStateGroup.Transitions> - <VisualState x:Name="Normal" /> - <VisualState x:Name="MouseOver"> - <Storyboard> - <ColorAnimation Duration="0" - Storyboard.TargetName="Background" - Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" - To="#FF448DCA" /> - <ColorAnimationUsingKeyFrames BeginTime="0" - Duration="00:00:00.001" - Storyboard.TargetName="BackgroundGradient" - Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)"> - <SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF" /> - </ColorAnimationUsingKeyFrames> - <ColorAnimationUsingKeyFrames BeginTime="0" - Duration="00:00:00.001" - Storyboard.TargetName="BackgroundGradient" - Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)"> - <SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF" /> - </ColorAnimationUsingKeyFrames> - <ColorAnimationUsingKeyFrames BeginTime="0" - Duration="00:00:00.001" - Storyboard.TargetName="BackgroundGradient" - Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"> - <SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF" /> - </ColorAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="Pressed"> - <Storyboard> - <ColorAnimationUsingKeyFrames BeginTime="0" - Duration="00:00:00.001" - Storyboard.TargetName="Background" - Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"> - <SplineColorKeyFrame KeyTime="0" Value="#FF448DCA" /> - </ColorAnimationUsingKeyFrames> - <DoubleAnimationUsingKeyFrames BeginTime="0" - Duration="00:00:00.001" - Storyboard.TargetName="Highlight" - Storyboard.TargetProperty="(UIElement.Opacity)"> - <SplineDoubleKeyFrame KeyTime="0" Value="1" /> - </DoubleAnimationUsingKeyFrames> - <ColorAnimationUsingKeyFrames BeginTime="0" - Duration="00:00:00.001" - Storyboard.TargetName="BackgroundGradient" - Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"> - <SplineColorKeyFrame KeyTime="0" Value="#EAFFFFFF" /> - </ColorAnimationUsingKeyFrames> - <ColorAnimationUsingKeyFrames BeginTime="0" - Duration="00:00:00.001" - Storyboard.TargetName="BackgroundGradient" - Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)"> - <SplineColorKeyFrame KeyTime="0" Value="#C6FFFFFF" /> - </ColorAnimationUsingKeyFrames> - <ColorAnimationUsingKeyFrames BeginTime="0" - Duration="00:00:00.001" - Storyboard.TargetName="BackgroundGradient" - Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)"> - <SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF" /> - </ColorAnimationUsingKeyFrames> - <ColorAnimationUsingKeyFrames BeginTime="0" - Duration="00:00:00.001" - Storyboard.TargetName="BackgroundGradient" - Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)"> - <SplineColorKeyFrame KeyTime="0" Value="#F4FFFFFF" /> - </ColorAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="Disabled"> - <Storyboard> - <DoubleAnimationUsingKeyFrames BeginTime="0" - Duration="00:00:00.001" - Storyboard.TargetName="DisabledVisual" - Storyboard.TargetProperty="(UIElement.Opacity)"> - <SplineDoubleKeyFrame KeyTime="0" Value="1" /> - </DoubleAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - <Grid Width="19" - Height="18" - Margin="0" - HorizontalAlignment="Center" - VerticalAlignment="Center" - Background="#11FFFFFF"> - <Grid.RowDefinitions> - <RowDefinition Height="23*" /> - <RowDefinition Height="19*" /> - <RowDefinition Height="19*" /> - <RowDefinition Height="19*" /> - </Grid.RowDefinitions> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="20*" /> - <ColumnDefinition Width="20*" /> - <ColumnDefinition Width="20*" /> - <ColumnDefinition Width="20*" /> - </Grid.ColumnDefinitions> - <Border x:Name="Highlight" - Grid.Row="0" - Grid.RowSpan="4" - Grid.ColumnSpan="4" - Margin="-1" - BorderBrush="#FF6DBDD1" - BorderThickness="1" - CornerRadius="0,0,1,1" - Opacity="0" /> - <Border x:Name="Background" - Grid.Row="1" - Grid.RowSpan="3" - Grid.ColumnSpan="4" - Margin="0,-1,0,0" - Background="#FF1F3B53" - BorderBrush="#FFFFFFFF" - BorderThickness="1" - CornerRadius=".5" - Opacity="1" /> - <Border x:Name="BackgroundGradient" - Grid.Row="1" - Grid.RowSpan="3" - Grid.ColumnSpan="4" - Margin="0,-1,0,0" - BorderBrush="#BF000000" - BorderThickness="1" - CornerRadius=".5" - Opacity="1"> - <Border.Background> - <LinearGradientBrush StartPoint=".7,0" EndPoint=".7,1"> - <GradientStop Offset="0" Color="#FFFFFFFF" /> - <GradientStop Offset="0.375" Color="#F9FFFFFF" /> - <GradientStop Offset="0.625" Color="#E5FFFFFF" /> - <GradientStop Offset="1" Color="#C6FFFFFF" /> - </LinearGradientBrush> - </Border.Background> - </Border> - <Rectangle Grid.RowSpan="1" - Grid.ColumnSpan="4" - StrokeThickness="1"> - <Rectangle.Stroke> - <LinearGradientBrush StartPoint="0.48,1.25" EndPoint="0.48,-1"> - <GradientStop Color="#FF494949" /> - <GradientStop Offset="1" Color="#FF9F9F9F" /> - </LinearGradientBrush> - </Rectangle.Stroke> - <Rectangle.Fill> - <LinearGradientBrush StartPoint="0.46,1.6" EndPoint="0.3,-1.1"> - <GradientStop Color="#FF4084BD" /> - <GradientStop Offset="1" Color="#FFAFCFEA" /> - </LinearGradientBrush> - </Rectangle.Fill> - </Rectangle> - <Path Grid.Row="1" - Grid.RowSpan="3" - Grid.Column="0" - Grid.ColumnSpan="4" - Margin="4,3,4,3" - HorizontalAlignment="Center" - VerticalAlignment="Center" - Data="M11.426758,8.4305077 L11.749023,8.4305077 L11.749023,16.331387 L10.674805,16.331387 L10.674805,10.299648 L9.0742188,11.298672 L9.0742188,10.294277 C9.4788408,10.090176 9.9094238,9.8090878 10.365967,9.4510155 C10.82251,9.0929432 11.176106,8.7527733 11.426758,8.4305077 z M14.65086,8.4305077 L18.566387,8.4305077 L18.566387,9.3435936 L15.671368,9.3435936 L15.671368,11.255703 C15.936341,11.058764 16.27293,10.960293 16.681133,10.960293 C17.411602,10.960293 17.969301,11.178717 18.354229,11.615566 C18.739157,12.052416 18.931622,12.673672 18.931622,13.479336 C18.931622,15.452317 18.052553,16.438808 16.294415,16.438808 C15.560365,16.438808 14.951641,16.234707 14.468243,15.826504 L14.881817,14.929531 C15.368796,15.326992 15.837872,15.525723 16.289043,15.525723 C17.298809,15.525723 17.803692,14.895514 17.803692,13.635098 C17.803692,12.460618 17.305971,11.873379 16.310528,11.873379 C15.83071,11.873379 15.399232,12.079271 15.016094,12.491055 L14.65086,12.238613 z" - Fill="#FF2F2F2F" - RenderTransformOrigin="0.5,0.5" - Stretch="Fill" /> - <Ellipse Grid.ColumnSpan="4" - Width="3" - Height="3" - HorizontalAlignment="Center" - VerticalAlignment="Center" - Fill="#FFFFFFFF" - StrokeThickness="0" /> - <Border x:Name="DisabledVisual" - Grid.Row="0" - Grid.RowSpan="4" - Grid.ColumnSpan="4" - BorderBrush="#B2FFFFFF" - BorderThickness="1" - CornerRadius="0,0,.5,.5" - Opacity="0" /> - </Grid> - </Grid> - </ControlTemplate> - </Grid.Resources> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal" /> - <VisualState x:Name="Disabled"> - <Storyboard> - <DoubleAnimation Duration="0" - Storyboard.TargetName="DisabledVisual" - Storyboard.TargetProperty="Opacity" - To="1" /> - </Storyboard> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="ValidationStates"> - <VisualState x:Name="Valid" /> - <VisualState x:Name="InvalidUnfocused"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <Visibility>Visible</Visibility> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="InvalidFocused"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <Visibility>Visible</Visibility> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <s:Boolean>True</s:Boolean> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> - <p:DatePickerTextBox x:Name="TextBox" - Grid.Column="0" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - Padding="{TemplateBinding Padding}" - SelectionBackground="{TemplateBinding SelectionBackground}" /> - <Button x:Name="Button" - Grid.Column="1" - Width="20" - Margin="2,0,2,0" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - Foreground="{TemplateBinding Foreground}" - Template="{StaticResource DropDownButtonTemplate}" /> - <Grid x:Name="DisabledVisual" - Grid.ColumnSpan="2" - IsHitTestVisible="False" - Opacity="0"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> - <Rectangle Fill="#8CFFFFFF" - RadiusX="1" - RadiusY="1" /> - <Rectangle Grid.Column="1" - Width="19" - Height="18" - Margin="2,0,2,0" - Fill="#8CFFFFFF" - RadiusX="1" - RadiusY="1" /> - </Grid> - <Popup x:Name="Popup" /> - <Border x:Name="ValidationErrorElement" - BorderBrush="#FFF3AB00" - BorderThickness="1" - CornerRadius="1" - Visibility="Collapsed"> - <ToolTipService.ToolTip> - <ToolTip x:Name="validationTooltip" - DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" - Placement="Right" - PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" - Template="{StaticResource ValidationToolTipTemplate}"> - <ToolTip.Triggers> - <EventTrigger RoutedEvent="Canvas.Loaded"> - <BeginStoryboard> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <s:Boolean>true</s:Boolean> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </BeginStoryboard> - </EventTrigger> - </ToolTip.Triggers> - </ToolTip> - </ToolTipService.ToolTip> - <Grid Width="12" - Height="12" - Margin="1,-4,-4,0" - HorizontalAlignment="Right" - VerticalAlignment="Top" - Background="Transparent"> - <Path Margin="1,3,0,0" - Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z" - Fill="#FFF3AB00" /> - <Path Margin="1,3,0,0" - Data="M 0,0 L2,0 L 8,6 L8,8" - Fill="#ffffff" /> - </Grid> - </Border> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - - <Style x:Key="ButtonStyle" TargetType="Button"> - <Setter Property="Height" Value="22" /> - <Setter Property="Margin" Value="5,0,0,0" /> - <Setter Property="VerticalAlignment" Value="Center" /> - <Setter Property="Width" Value="60" /> - </Style> - - <Style x:Key="ValidationSummaryStyle" TargetType="sdk:ValidationSummary"> - <Setter Property="IsTabStop" Value="False" /> - <Setter Property="Background" Value="#FFEFEFEA" /> - <Setter Property="BorderBrush" Value="#FFCECEC7" /> - <Setter Property="BorderThickness" Value="1" /> - <Setter Property="Padding" Value="0" /> - - <Setter Property="HeaderTemplate"> - <Setter.Value> - <DataTemplate> - <Border x:Name="Header" - Margin="-1,-1,-1,0" - Background="#FFF3AB00" - CornerRadius="2"> - <StackPanel Margin="6,2,6,4" - VerticalAlignment="Top" - Orientation="Horizontal"> - <Grid Width="13" Height="13"> - <Ellipse Margin="0" RenderTransformOrigin="0.5,0.5"> - <Ellipse.Fill> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Offset="0" Color="#FFFFFFFF" /> - <GradientStop Offset="1" Color="#FFFDC8C8" /> - </LinearGradientBrush> - </Ellipse.Fill> - <Ellipse.Stroke> - <LinearGradientBrush StartPoint="0.505,0.65" EndPoint="0.5,0.058"> - <GradientStop Offset="0" Color="#FFF3AB00" /> - <GradientStop Offset="0.991" Color="#FFFF9298" /> - </LinearGradientBrush> - </Ellipse.Stroke> - </Ellipse> - <Path Data="M5.5,2.5 L7.5,2.5 L7.5,8 L5.5,8 M5.5,9.5 L7.5,9.5 L7.5,10.5 L5.5,10.5" Fill="#DDD43940" /> - </Grid> - <TextBlock FontWeight="Bold" - Foreground="#FFFFFFFF" - Padding="4,1,0,0" - Text="{Binding}" /> - </StackPanel> - </Border> - </DataTemplate> - </Setter.Value> - </Setter> - <Setter Property="ErrorStyle"> - <Setter.Value> - <Style TargetType="ListBoxItem"> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="ListBoxItem"> - <Grid Background="{TemplateBinding Background}"> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal" /> - <VisualState x:Name="MouseOver"> - <Storyboard> - <DoubleAnimation Duration="0" - Storyboard.TargetName="FillColor" - Storyboard.TargetProperty="Opacity" - To=".35" /> - </Storyboard> - </VisualState> - <VisualState x:Name="Disabled"> - <Storyboard> - <DoubleAnimation Duration="0" - Storyboard.TargetName="ContentPresenter" - Storyboard.TargetProperty="Opacity" - To=".55" /> - </Storyboard> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="SelectionStates"> - <VisualState x:Name="Unselected" /> - <VisualState x:Name="Selected"> - <Storyboard> - <DoubleAnimation Duration="0" - Storyboard.TargetName="FillColor2" - Storyboard.TargetProperty="Opacity" - To=".75" /> - </Storyboard> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="FocusStates"> - <VisualState x:Name="Focused"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Duration="0" - Storyboard.TargetName="FocusVisualElement" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="Unfocused" /> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - <Rectangle x:Name="FillColor" - Fill="#59F7D8DB" - IsHitTestVisible="False" - Opacity="0" - RadiusX="1" - RadiusY="1" /> - <Rectangle x:Name="FillColor2" - Fill="#FFF7D8DB" - IsHitTestVisible="False" - Opacity="0" - RadiusX="1" - RadiusY="1" /> - <ContentPresenter x:Name="ContentPresenter" - Margin="{TemplateBinding Padding}" - HorizontalAlignment="Left" - Content="{TemplateBinding Content}" - ContentTemplate="{TemplateBinding ContentTemplate}" /> - <Rectangle x:Name="FocusVisualElement" - RadiusX="1" - RadiusY="1" - Stroke="#FFF7D8DB" - StrokeThickness="1" - Visibility="Collapsed" /> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - </Setter.Value> - </Setter> - <Setter Property="Template"> - <Setter.Value> - <ControlTemplate TargetType="sdk:ValidationSummary"> - <Grid x:Name="ValidationSummary"> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal" /> - <VisualState x:Name="Disabled"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Duration="0" - Storyboard.TargetName="DisabledVisual" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="ValidationStates"> - <VisualState x:Name="Empty"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Duration="0" - Storyboard.TargetName="Content" - Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" /> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="HasErrors" /> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - <Border x:Name="Content" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="0,0,2,2"> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="*" /> - </Grid.RowDefinitions> - <ListBox x:Name="SummaryListBox" - Grid.Row="1" - Height="Auto" - Background="{x:Null}" - BorderThickness="0" - Foreground="{TemplateBinding Foreground}" - ItemContainerStyle="{TemplateBinding ErrorStyle}" - Padding="{TemplateBinding Padding}" - Style="{TemplateBinding SummaryListBoxStyle}"> - <ListBox.ItemTemplate> - <DataTemplate> - <StackPanel Orientation="Horizontal"> - <TextBlock Margin="4,0,0,0" - FontWeight="Bold" - Text="{Binding MessageHeader}" /> - <TextBlock Margin="4,0,0,0" Text="{Binding Message}" /> - </StackPanel> - </DataTemplate> - </ListBox.ItemTemplate> - </ListBox> - <Border x:Name="DisabledVisual" - Grid.RowSpan="2" - Background="#80FFFFFF" - IsHitTestVisible="True" - Visibility="Collapsed" /> - <ContentControl x:Name="HeaderContentControl" - HorizontalContentAlignment="Stretch" - VerticalContentAlignment="Center" - Content="{TemplateBinding Header}" - ContentTemplate="{TemplateBinding HeaderTemplate}" - IsTabStop="False" /> - </Grid> - </Border> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - - <Style x:Key="PasswordBoxStyle" TargetType="PasswordBox"> - <Setter Property="FontFamily" Value="Segoe UI Light" /> - <Setter Property="FontSize" Value="12" /> - <Setter Property="Height" Value="24" /> - <Setter Property="VerticalAlignment" Value="Center" /> - <Setter Property="BorderThickness" Value="1" /> - <Setter Property="Background" Value="#FFFFFFFF" /> - <Setter Property="Foreground" Value="#FF000000" /> - <Setter Property="Padding" Value="2" /> - <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="PasswordBox"> - <Grid x:Name="RootElement"> - <VisualStateManager.VisualStateGroups> - <VisualStateGroup x:Name="CommonStates"> - <VisualState x:Name="Normal" /> - <VisualState x:Name="MouseOver"> - <Storyboard> - <ColorAnimation Duration="0" - Storyboard.TargetName="MouseOverBorder" - Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" - To="#FF99C1E2" /> - </Storyboard> - </VisualState> - <VisualState x:Name="Disabled"> - <Storyboard> - <DoubleAnimation Duration="0" - Storyboard.TargetName="DisabledVisualElement" - Storyboard.TargetProperty="Opacity" - To="1" /> - </Storyboard> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="FocusStates"> - <VisualState x:Name="Focused"> - <Storyboard> - <DoubleAnimation Duration="0" - Storyboard.TargetName="FocusVisualElement" - Storyboard.TargetProperty="Opacity" - To="1" /> - </Storyboard> - </VisualState> - <VisualState x:Name="Unfocused"> - <Storyboard> - <DoubleAnimation Duration="0" - Storyboard.TargetName="FocusVisualElement" - Storyboard.TargetProperty="Opacity" - To="0" /> - </Storyboard> - </VisualState> - </VisualStateGroup> - <VisualStateGroup x:Name="ValidationStates"> - <VisualState x:Name="Valid" /> - <VisualState x:Name="InvalidUnfocused"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <Visibility>Visible</Visibility> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - <VisualState x:Name="InvalidFocused"> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <Visibility>Visible</Visibility> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <s:Boolean>True</s:Boolean> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </VisualState> - </VisualStateGroup> - </VisualStateManager.VisualStateGroups> - <Border x:Name="Border" - Background="{TemplateBinding Background}" - BorderBrush="{TemplateBinding BorderBrush}" - BorderThickness="{TemplateBinding BorderThickness}" - CornerRadius="1" - Opacity="1"> - <Border x:Name="MouseOverBorder" - BorderBrush="Transparent" - BorderThickness="1"> - <Border x:Name="ContentElement" Margin="{TemplateBinding Padding}" /> - </Border> - </Border> - <Border x:Name="DisabledVisualElement" - Background="#A5F7F7F7" - BorderBrush="#A5F7F7F7" - BorderThickness="{TemplateBinding BorderThickness}" - IsHitTestVisible="False" - Opacity="0" /> - <Border x:Name="FocusVisualElement" - Margin="1" - BorderBrush="#FF6DBDD1" - BorderThickness="{TemplateBinding BorderThickness}" - IsHitTestVisible="False" - Opacity="0" /> - <Border x:Name="ValidationErrorElement" - BorderBrush="#FFF3AB00" - BorderThickness="1" - CornerRadius="1" - Visibility="Collapsed"> - <ToolTipService.ToolTip> - <ToolTip x:Name="validationTooltip" - DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" - Placement="Right" - PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" - Template="{StaticResource ValidationToolTipTemplate}"> - <ToolTip.Triggers> - <EventTrigger RoutedEvent="Canvas.Loaded"> - <BeginStoryboard> - <Storyboard> - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible"> - <DiscreteObjectKeyFrame KeyTime="0"> - <DiscreteObjectKeyFrame.Value> - <s:Boolean>true</s:Boolean> - </DiscreteObjectKeyFrame.Value> - </DiscreteObjectKeyFrame> - </ObjectAnimationUsingKeyFrames> - </Storyboard> - </BeginStoryboard> - </EventTrigger> - </ToolTip.Triggers> - </ToolTip> - </ToolTipService.ToolTip> - <Grid Width="12" - Height="12" - Margin="1,-4,-4,0" - HorizontalAlignment="Right" - VerticalAlignment="Top" - Background="Transparent"> - <Path Margin="1,3,0,0" - Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z" - Fill="#FFF3AB00" /> - <Path Margin="1,3,0,0" - Data="M 0,0 L2,0 L 8,6 L8,8" - Fill="#ffffff" /> - </Grid> - </Border> - </Grid> - </ControlTemplate> - </Setter.Value> - </Setter> - </Style> - </Application.Resources> -</Application>
--- a/delete me/SilverlightValidation/App.xaml.cs Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -using System; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Navigation; -using Glimpse; -//using SilverlightGlimpse.Services; - -namespace SilverlightValidation -{ - public partial class App : Application - { - public App() - { - this.Startup += this.Application_Startup; - this.Exit += this.Application_Exit; - this.UnhandledException += this.Application_UnhandledException; - - InitializeComponent(); - } - - private void Application_Startup(object sender, StartupEventArgs e) - { - try - { - this.RootVisual = new Views.UserListView(); - GlimpseService.CreateInstance.Load(this, "Silverlight Glimpse"); - } - catch (Exception ex) - { - GlimpseService.CreateInstance.DisplayLoadFailure(this, ex, "Glimpse Demo"); - } - } - - private void Application_Exit(object sender, EventArgs e) - { - - } - - private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) - { - // If the app is running outside of the debugger then report the exception using - // the browser's exception mechanism. On IE this will display it a yellow alert - // icon in the status bar and Firefox will display a script error. - if (!System.Diagnostics.Debugger.IsAttached) - { - - // NOTE: This will allow the application to continue running after an exception has been thrown - // but not handled. - // For production applications this error handling should be replaced with something that will - // report the error to the website and stop the application. - e.Handled = true; - Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); - } - } - - private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) - { - try - { - string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; - errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); - - System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); - } - catch (Exception) - { - } - } - } -}
--- a/delete me/SilverlightValidation/Commands/RelayCommand.cs Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -using System; -using System.Windows.Input; - -namespace SilverlightValidation.Commands -{ - public class RelayCommand : ICommand - { - public event EventHandler CanExecuteChanged = delegate { }; - - readonly Action<object> _execute; - readonly Predicate<object> _canExecute; - - public RelayCommand(Action<object> execute, - Predicate<object> canExecute = null) - { - if (execute == null) throw new ArgumentNullException("execute"); - - _execute = execute; - _canExecute = canExecute; - } - - - public void UpdateCanExecuteCommand() - { - CanExecuteChanged(this, new EventArgs()); - } - - - public bool CanExecute(object parameter) - { - return _canExecute == null || _canExecute(parameter); - } - - - public void Execute(object parameter) - { - _execute(parameter); - } - } -}
--- a/delete me/SilverlightValidation/Data/Factory.cs Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using SilverlightValidation.Models; - -namespace SilverlightValidation.Data -{ - public class Factory - { - public static IList<UserModel> CreateUserModels() - { - return new List<UserModel>(5) - { - new UserModel() { Username = "StevenH", Password = "Password1*", Email = "steven@hotmail.com", DateOfBirth = new DateTime(1977, 09, 01), Description = ""}, - new UserModel() { Username = "RichardJ", Password = "&12N456a", Email = "dicky@gmail.com", DateOfBirth = new DateTime(1983, 03, 13), Description = "Rebel"}, - new UserModel() { Username = "BobbyP", Password = "p@a33Word", Email = "bob@yahoo.co.uk", DateOfBirth = new DateTime(1992, 08, 30), Description = ""}, - new UserModel() { Username = "DavidM", Password = "][poIu789*", Email = "daveyboy@marsh.com", DateOfBirth = new DateTime(1965, 06, 21), Description = "Renegade"}, - new UserModel() { Username = "JessieJ", Password = "';lkJh567", Email = "jj@apple.co.uk", DateOfBirth = new DateTime(1990, 10, 15), Description = ""} - }; - } - } -}
--- a/delete me/SilverlightValidation/Diagrams/Form.cd Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<ClassDiagram MajorVersion="1" MinorVersion="1"> - <Class Name="SilverlightValidation.RelayCommand" Collapsed="true" BaseTypeListCollapsed="true"> - <Position X="6.75" Y="5.5" Width="2" /> - <TypeIdentifier> - <HashCode>AAAAAAAAIEACAAQAAECAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode> - <FileName>RelayCommand.cs</FileName> - </TypeIdentifier> - <Lollipop Position="0.2" Collapsed="true" /> - </Class> - <Class Name="SilverlightValidation.ViewModelBase"> - <Position X="1.75" Y="0.5" Width="2" /> - <TypeIdentifier> - <HashCode>AAAAAAACAABQAAABAAAAAgAAgAAAAACIAAAAAAARAAA=</HashCode> - <FileName>ViewModelBase.cs</FileName> - </TypeIdentifier> - <Lollipop Position="0.2" /> - </Class> - <Class Name="SilverlightValidation.UserModel" BaseTypeListCollapsed="true"> - <Position X="9.25" Y="0.5" Width="1.5" /> - <TypeIdentifier> - <HashCode>AAAAAAAAACAgAAAAAQAAAAAAAAAQAEACAAAAAAAAABA=</HashCode> - <FileName>UserModel.cs</FileName> - </TypeIdentifier> - <Lollipop Position="0.2" Collapsed="true" /> - </Class> - <Class Name="SilverlightValidation.UserModelValidator"> - <Position X="6.75" Y="3.75" Width="2" /> - <TypeIdentifier> - <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAA=</HashCode> - <FileName>UserModelValidator.cs</FileName> - </TypeIdentifier> - </Class> - <Class Name="SilverlightValidation.UserViewModel"> - <Position X="4.25" Y="0.5" Width="2" /> - <TypeIdentifier> - <HashCode>UAAAoIIABCIgAAAAEYAAGAAAAAAQABAKQAAAAAAAIAA=</HashCode> - <FileName>UserViewModel.cs</FileName> - </TypeIdentifier> - <Lollipop Position="0.2" /> - </Class> - <Interface Name="SilverlightValidation.IUserModel"> - <Position X="6.75" Y="0.5" Width="2" /> - <TypeIdentifier> - <HashCode>AAAAAAAAACAgAAAAAQAAAAAAAAAQAAACAAAAAAAAAAA=</HashCode> - <FileName>UserModel.cs</FileName> - </TypeIdentifier> - </Interface> - <Interface Name="SilverlightValidation.ICloneable<T>"> - <Position X="6.75" Y="2.5" Width="2" /> - <TypeIdentifier> - <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA=</HashCode> - <FileName>UserModel.cs</FileName> - </TypeIdentifier> - </Interface> - <Font Name="Segoe UI" Size="9" /> -</ClassDiagram> \ No newline at end of file
--- a/delete me/SilverlightValidation/Diagrams/List.cd Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<ClassDiagram MajorVersion="1" MinorVersion="1"> - <Class Name="SilverlightValidation.UserListViewModel"> - <Position X="8.25" Y="0.75" Width="2" /> - <TypeIdentifier> - <HashCode>QAAAIAIAAAIAAAAAAAAAEAAAAAAAABAIQAAAAAAAAAA=</HashCode> - <FileName>UserListViewModel.cs</FileName> - </TypeIdentifier> - <Lollipop Position="0.2" /> - </Class> - <Class Name="SilverlightValidation.ViewModelBase"> - <Position X="5.5" Y="0.75" Width="2.25" /> - <TypeIdentifier> - <HashCode>AAAAAAACAABQAAABAAAAAgAAgAAAAACIAAAAAAARAAA=</HashCode> - <FileName>ViewModelBase.cs</FileName> - </TypeIdentifier> - <Lollipop Position="0.2" /> - </Class> - <Class Name="SilverlightValidation.UserViewModel"> - <Position X="3" Y="0.75" Width="2" /> - <TypeIdentifier> - <HashCode>UAAAoIIADCIgAAAAEYAAGAAAAAAQABAKQEAAAAAgIAA=</HashCode> - <FileName>UserViewModel.cs</FileName> - </TypeIdentifier> - <Lollipop Position="0.2" /> - </Class> - <Class Name="SilverlightValidation.UserModel" BaseTypeListCollapsed="true"> - <Position X="5.5" Y="4.75" Width="2.25" /> - <TypeIdentifier> - <HashCode>AAAAAAAAACAgAAAAAQAAAAAAAAAQAEACAAAAAAAAABA=</HashCode> - <FileName>UserModel.cs</FileName> - </TypeIdentifier> - <Lollipop Position="0.2" Collapsed="true" /> - </Class> - <Interface Name="SilverlightValidation.IUserModel"> - <Position X="8.25" Y="4.75" Width="1.5" /> - <TypeIdentifier> - <HashCode>AAAAAAAAACAgAAAAAQAAAAAAAAAQAAACAAAAAAAAAAA=</HashCode> - <FileName>UserModel.cs</FileName> - </TypeIdentifier> - </Interface> - <Font Name="Segoe UI" Size="9" /> -</ClassDiagram> \ No newline at end of file
--- a/delete me/SilverlightValidation/Interfaces/ICloneable.cs Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -namespace SilverlightValidation.Interfaces -{ - public interface ICloneable<T> - { - T Clone(); - } -}
--- a/delete me/SilverlightValidation/Interfaces/IUserModel.cs Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -using System; -namespace SilverlightValidation.Interfaces -{ - public interface IUserModel - { - string Username { get; set; } - string Email { get; set; } - string Password { get; set; } - DateTime? DateOfBirth { get; set; } - string Description { get; set; } - } -}
--- a/delete me/SilverlightValidation/Models/UserModel.cs Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -using System; -using System.ComponentModel; -using SilverlightValidation.Interfaces; - -namespace SilverlightValidation.Models -{ - public class UserModel : IUserModel, ICloneable<UserModel> - { - public string Username { get; set; } - public string Email { get; set; } - public string Password { get; set; } - public DateTime? DateOfBirth { get; set; } - public string Description { get; set; } - - public static UserModel Create() - { - return new UserModel() { Username = "", Email = "", Password = "", DateOfBirth = null, Description = "" }; - } - - public UserModel Clone() - { - return (UserModel) this.MemberwiseClone(); - } - } -}
--- a/delete me/SilverlightValidation/Properties/AppManifest.xml Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" -> - <Deployment.Parts> - </Deployment.Parts> -</Deployment>
--- a/delete me/SilverlightValidation/Properties/AssemblyInfo.cs Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SilverlightValidation")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SilverlightValidation")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3f5a4c47-8fbd-4568-8728-e26ee6a51945")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file
--- a/delete me/SilverlightValidation/SilverlightValidation.csproj Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{0C1CC1FC-915A-4428-8952-CDC79EABC3F4}</ProjectGuid> - <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>SilverlightValidation</RootNamespace> - <AssemblyName>SilverlightValidation</AssemblyName> - <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier> - <TargetFrameworkVersion>v5.0</TargetFrameworkVersion> - <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion> - <SilverlightApplication>true</SilverlightApplication> - <SupportedCultures> - </SupportedCultures> - <XapOutputs>true</XapOutputs> - <GenerateSilverlightManifest>true</GenerateSilverlightManifest> - <XapFilename>SilverlightValidation.xap</XapFilename> - <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate> - <SilverlightAppEntry>SilverlightValidation.App</SilverlightAppEntry> - <TestPageFileName>SilverlightValidationTestPage.html</TestPageFileName> - <CreateTestPage>true</CreateTestPage> - <ValidateXaml>true</ValidateXaml> - <EnableOutOfBrowser>false</EnableOutOfBrowser> - <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile> - <UsePlatformExtensions>false</UsePlatformExtensions> - <ThrowErrorsInValidation>true</ThrowErrorsInValidation> - <LinkedServerProject> - </LinkedServerProject> - </PropertyGroup> - <!-- This property group is only here to support building this project using the - MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs - to set the TargetFrameworkVersion to v3.5 --> - <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'"> - <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>Bin\Debug</OutputPath> - <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants> - <NoStdLib>true</NoStdLib> - <NoConfig>true</NoConfig> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>Bin\Release</OutputPath> - <DefineConstants>TRACE;SILVERLIGHT</DefineConstants> - <NoStdLib>true</NoStdLib> - <NoConfig>true</NoConfig> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="FluentValidation"> - <HintPath>..\Libs\FluentValidation.dll</HintPath> - </Reference> - <Reference Include="mscorlib" /> - <Reference Include="System.ComponentModel.DataAnnotations, Version=5.0.5.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217, processorArchitecture=MSIL" /> - <Reference Include="System.Windows" /> - <Reference Include="system" /> - <Reference Include="System.Core" /> - <Reference Include="System.Windows.Controls, Version=5.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\Libs\System.Windows.Controls.dll</HintPath> - </Reference> - <Reference Include="System.Windows.Controls.Data, Version=5.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\Libs\System.Windows.Controls.Data.dll</HintPath> - </Reference> - <Reference Include="System.Windows.Controls.Data.Input, Version=5.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\Libs\System.Windows.Controls.Data.Input.dll</HintPath> - </Reference> - <Reference Include="System.Windows.Controls.Navigation, Version=5.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> - <HintPath>..\Libs\System.Windows.Controls.Navigation.dll</HintPath> - </Reference> - <Reference Include="System.Xml" /> - <Reference Include="System.Windows.Browser" /> - </ItemGroup> - <ItemGroup> - <Compile Include="App.xaml.cs"> - <DependentUpon>App.xaml</DependentUpon> - </Compile> - <Compile Include="Data\Factory.cs" /> - <Compile Include="Interfaces\ICloneable.cs" /> - <Compile Include="Interfaces\IUserModel.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="Commands\RelayCommand.cs" /> - <Compile Include="ViewModels\UserListViewModel.cs" /> - <Compile Include="Models\UserModel.cs" /> - <Compile Include="Validators\UserModelValidator.cs" /> - <Compile Include="Views\UserListView.xaml.cs"> - <DependentUpon>UserListView.xaml</DependentUpon> - </Compile> - <Compile Include="Views\UserView.xaml.cs"> - <DependentUpon>UserView.xaml</DependentUpon> - </Compile> - <Compile Include="ViewModels\UserViewModel.cs" /> - <Compile Include="ViewModels\ViewModelBase.cs" /> - </ItemGroup> - <ItemGroup> - <ApplicationDefinition Include="App.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:Compile</Generator> - </ApplicationDefinition> - <Page Include="Views\UserListView.xaml"> - <SubType>Designer</SubType> - <Generator>MSBuild:Compile</Generator> - </Page> - <Page Include="Views\UserView.xaml"> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> - </ItemGroup> - <ItemGroup> - <None Include="Diagrams\List.cd" /> - <None Include="Diagrams\Form.cd" /> - <None Include="Properties\AppManifest.xml" /> - </ItemGroup> - <ItemGroup> - <Folder Include="Messages\" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\Glimpse\Glimpse.vbproj"> - <Project>{C72D72F7-C49B-46DF-BD6C-0E14DBCD8F95}</Project> - <Name>Glimpse</Name> - </ProjectReference> - </ItemGroup> - <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> - <ProjectExtensions> - <VisualStudio> - <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}"> - <SilverlightProjectProperties /> - </FlavorProperties> - </VisualStudio> - </ProjectExtensions> -</Project> \ No newline at end of file
--- a/delete me/SilverlightValidation/Validators/UserModelValidator.cs Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -using System; -using FluentValidation; -using SilverlightValidation.Interfaces; - -namespace SilverlightValidation.Validators -{ - public class UserModelValidator : AbstractValidator<IUserModel> - { - public UserModelValidator() - { - RuleFor(x => x.Username) - .Length(3, 8) - .WithMessage("Must be between 3-8 characters."); - - RuleFor(x => x.Password) - .Matches(@"^\w*(?=\w*\d)(?=\w*[a-z])(?=\w*[A-Z])\w*$") - .WithMessage("Must contain lower, upper and numeric chars."); - - RuleFor(x => x.Email) - .EmailAddress() - .WithMessage("A valid email address is required."); - - RuleFor(x => x.DateOfBirth) - .Must(BeAValidDateOfBirth) - .WithMessage("Must be within 100 years of today."); - } - - private bool BeAValidDateOfBirth(DateTime? dateOfBirth) - { - if (dateOfBirth == null) return false; - if (dateOfBirth.Value > DateTime.Today || dateOfBirth < DateTime.Today.AddYears(-100)) - return false; - return true; - } - } -}
--- a/delete me/SilverlightValidation/ViewModels/UserListViewModel.cs Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Windows.Input; -using SilverlightValidation.Commands; -using SilverlightValidation.Models; -using SilverlightValidation.Validators; - -namespace SilverlightValidation.ViewModels -{ - public class UserListViewModel - { - public UserListViewModel(IList<UserModel> models, UserModelValidator validator) - { - Data = new ObservableCollection<UserViewModel>(); - - foreach (var model in models) - Data.Add(new UserViewModel(model, validator)); - - AddCommand = new RelayCommand(AddCommandExecute); - DeleteCommand = new RelayCommand(DeleteCommandExecute); - } - - #region Properties - - public ObservableCollection<UserViewModel> Data { get; set; } - - public UserViewModel SelectedItem { get; set; } - - #endregion - - #region Commands - - public ICommand AddCommand { get; set; } - public ICommand DeleteCommand { get; set; } - - private void AddCommandExecute(object obj) - { - - } - - private void DeleteCommandExecute(object obj) - { - Data.Remove(SelectedItem); - } - - #endregion - } -} \ No newline at end of file
--- a/delete me/SilverlightValidation/ViewModels/UserViewModel.cs Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,227 +0,0 @@ -using System; -using System.ComponentModel; -using System.Linq; -using System.Windows; -using System.Windows.Input; -using FluentValidation; -using SilverlightValidation.Interfaces; -using SilverlightValidation.Validators; -using SilverlightValidation.Models; -using SilverlightValidation.Commands; - -namespace SilverlightValidation.ViewModels -{ - public class UserViewModel : ViewModelBase, IUserModel, IChangeTracking, IEditableObject - { - #region Fields - - private readonly UserModelValidator _validator; - private UserModel _data; - private UserModel _backup; - - #endregion - - #region Constructor - - public UserViewModel(UserModel model, UserModelValidator validator) - { - _validator = validator; - _data = model; - _backup = model.Clone(); - - OkCommand = new RelayCommand(OkCommandExecute); - CancelCommand = new RelayCommand(CancelCommandExecute); - } - - #endregion - - #region Methods - - private void SetProperties(IUserModel source) - { - Username = source.Username; - Password = source.Password; - Email = source.Email; - DateOfBirth = source.DateOfBirth; - Description = source.Description; - } - - #endregion - - #region Properties - - private const string UsernameProperty = "Username"; - public string Username - { - get { return _data.Username; } - set - { - if (_data.Username != value) - { - _data.Username = value; - RaisePropertyChanged(UsernameProperty); - IsChanged = true; - } - - ClearError(UsernameProperty); - var validationResult = _validator.Validate(this, UsernameProperty); - if (!validationResult.IsValid) - validationResult.Errors.ToList().ForEach(x => SetError(UsernameProperty, x.ErrorMessage)); - } - } - - private const string PasswordProperty = "Password"; - public string Password - { - get { return _data.Password; } - set - { - if (_data.Password != value) - { - _data.Password = value; - RaisePropertyChanged(PasswordProperty); - IsChanged = true; - } - - ClearError(PasswordProperty); - var validationResult = _validator.Validate(this, PasswordProperty); - if (!validationResult.IsValid) - validationResult.Errors.ToList().ForEach(x => SetError(PasswordProperty, x.ErrorMessage)); - } - } - - private const string EmailProperty = "Email"; - public string Email - { - get { return _data.Email; } - set - { - if (_data.Email != value) - { - _data.Email = value; - RaisePropertyChanged(EmailProperty); - IsChanged = true; - } - - ClearError(EmailProperty); - var validationResult = _validator.Validate(this, EmailProperty); - if (!validationResult.IsValid) - validationResult.Errors.ToList().ForEach(x => SetError(EmailProperty, x.ErrorMessage)); - } - } - - private const string DateOfBirthProperty = "DateOfBirth"; - public DateTime? DateOfBirth - { - get { return _data.DateOfBirth; } - set - { - if (_data.DateOfBirth != value) - { - _data.DateOfBirth = value; - RaisePropertyChanged(DateOfBirthProperty); - IsChanged = true; - } - - ClearError(DateOfBirthProperty); - var validationResult = _validator.Validate(this, DateOfBirthProperty); - if (!validationResult.IsValid) - validationResult.Errors.ToList().ForEach(x => SetError(DateOfBirthProperty, x.ErrorMessage)); - } - } - - private const string DescriptionProperty = "Description"; - public string Description - { - get { return _data.Description; } - set - { - if (_data.Description != value) - { - _data.Description = value; - RaisePropertyChanged(DescriptionProperty); - IsChanged = true; - } - - ClearError(DescriptionProperty); - var validationResult = _validator.Validate(this, DescriptionProperty); - if (!validationResult.IsValid) - validationResult.Errors.ToList().ForEach(x => SetError(DescriptionProperty, x.ErrorMessage)); - } - } - - #endregion - - #region Commands - - public ICommand OkCommand { get; set; } - public ICommand CancelCommand { get; set; } - - private void OkCommandExecute(object obj) - { - SetProperties(_data); - - if (IsChanged && !HasErrors) - { - AcceptChanges(); - } - } - - private void CancelCommandExecute(object obj) - { - CancelChanges(); - } - - #endregion - - #region IChangeTrack plus Cancel - - public void AcceptChanges() - { - MessageBox.Show("Saving..."); - SetProperties(_backup); - - ClearAllErrors(); - IsChanged = false; - } - - public void CancelChanges() - { - if (!IsChanged) return; - SetProperties(_backup); - ClearAllErrors(); - IsChanged = false; - } - - public bool IsChanged { get; private set; } - - #endregion - - #region - - private bool inEdit; - public void BeginEdit() - { - if (inEdit) return; - inEdit = true; - SetProperties(_backup); - } - - public void CancelEdit() - { - if (!inEdit) return; - inEdit = false; - CancelChanges(); - } - - public void EndEdit() - { - if (!inEdit) return; - inEdit = false; - SetProperties(_backup); - } - - #endregion - - } -}
--- a/delete me/SilverlightValidation/ViewModels/ViewModelBase.cs Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; - -namespace SilverlightValidation.ViewModels -{ - public class ViewModelBase : INotifyPropertyChanged, INotifyDataErrorInfo - { - #region INotifyPropertyChanged method plus event - - public event PropertyChangedEventHandler PropertyChanged = delegate { }; - - protected void RaisePropertyChanged(string propertyName) - { - PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - - #endregion - - #region INotifyDataErrorInfo methods and helpers - - private readonly Dictionary<string, List<string>> _errors = new Dictionary<string, List<string>>(); - - public void SetError(string propertyName, string errorMessage) - { - if (!_errors.ContainsKey(propertyName)) - _errors.Add(propertyName, new List<string> { errorMessage }); - - RaiseErrorsChanged(propertyName); - } - - protected void ClearError(string propertyName) - { - if (_errors.ContainsKey(propertyName)) - { - _errors.Remove(propertyName); - RaiseErrorsChanged(propertyName); - } - } - - protected void ClearAllErrors() - { - var errors = _errors.Select(error => error.Key).ToList(); - - foreach (var propertyName in errors) - ClearError(propertyName); - } - - public void RaiseErrorsChanged(string propertyName) - { - ErrorsChanged(this, new DataErrorsChangedEventArgs(propertyName)); - } - - public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged = delegate { }; - - public IEnumerable GetErrors(string propertyName) - { - if (propertyName == null) return null; - return _errors.ContainsKey(propertyName) - ? _errors[propertyName] - : null; - } - - public bool HasErrors - { - get { return _errors.Count > 0; } - } - - #endregion - } -}
--- a/delete me/SilverlightValidation/Views/UserListView.xaml Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -<UserControl x:Class="SilverlightValidation.Views.UserListView" - 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;assembly=System.Windows.Controls.Data" - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:p="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls" - xmlns:s="clr-namespace:System;assembly=mscorlib" - xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" - d:DesignHeight="400" - d:DesignWidth="725" - mc:Ignorable="d"> - - <Grid x:Name="LayoutRoot" Background="White"> - <Grid.RowDefinitions> - <RowDefinition Height="30" /> - <RowDefinition Height="40" /> - <RowDefinition Height="300" /> - <RowDefinition Height="50" /> - </Grid.RowDefinitions> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="725" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - - <StackPanel Grid.Row="1" - Grid.Column="1" - HorizontalAlignment="Right" - Orientation="Horizontal"> - <Button Width="60" - Command="{Binding AddCommand}" - Content="Add" - Style="{StaticResource ButtonStyle}" /> - <Button Width="60" - Command="{Binding CancelCommand}" - Content="Delete" - Style="{StaticResource ButtonStyle}" /> - </StackPanel> - - <controls:DataGrid Grid.Row="2" - Grid.Column="1" - AutoGenerateColumns="False" - ItemsSource="{Binding Data}" - SelectedItem="{Binding SelectedItem}"> - <controls:DataGrid.Columns> - <controls:DataGridTextColumn Width="125" - Binding="{Binding Username, - Mode=TwoWay, - ValidatesOnNotifyDataErrors=True, - NotifyOnValidationError=True}" - Header="Username" /> - <controls:DataGridTemplateColumn Width="125" Header="Password"> - <sdk:DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <PasswordBox Password="{Binding Password, Mode=TwoWay, ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}" /> - </DataTemplate> - </sdk:DataGridTemplateColumn.CellTemplate> - </controls:DataGridTemplateColumn> - <controls:DataGridTextColumn Width="150" - Binding="{Binding Email, - Mode=TwoWay, - ValidatesOnNotifyDataErrors=True, - NotifyOnValidationError=True}" - Header="Email" /> - - <controls:DataGridTemplateColumn Width="150" Header="Date of Birth"> - <sdk:DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <sdk:DatePicker KeyDown="DatePicker_KeyDown" SelectedDate="{Binding DateOfBirth, Mode=TwoWay, ValidatesOnNotifyDataErrors=True, NotifyOnValidationError=True}" /> - </DataTemplate> - </sdk:DataGridTemplateColumn.CellTemplate> - </controls:DataGridTemplateColumn> - <controls:DataGridTextColumn Width="150" - Binding="{Binding XXXDescription, - Mode=TwoWay, - ValidatesOnNotifyDataErrors=True, - NotifyOnValidationError=True}" - Header="Description" /> - </controls:DataGrid.Columns> - </controls:DataGrid> - </Grid> -</UserControl>
--- a/delete me/SilverlightValidation/Views/UserListView.xaml.cs Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -using System.Windows.Browser; -using System.Windows.Input; -using SilverlightValidation.Data; -using SilverlightValidation.ViewModels; -using SilverlightValidation.Validators; - -namespace SilverlightValidation.Views -{ - public partial class UserListView - { - private UserListViewModel vm; - - public UserListView() - { - InitializeComponent(); - HtmlPage.Document.SetProperty("title", "Silverlight Validation"); - - vm = new UserListViewModel(Factory.CreateUserModels(), new UserModelValidator()); - this.DataContext = vm; - } - - private void DatePicker_KeyDown(object sender, KeyEventArgs e) - { - if (e.Key != Key.Tab) - e.Handled = true; - } - } -}
--- a/delete me/SilverlightValidation/Views/UserView.xaml Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -<UserControl x:Class="SilverlightValidation.Views.UserView" - 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" - xmlns:p="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls" - xmlns:s="clr-namespace:System;assembly=mscorlib" - xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" - d:DesignHeight="400" - d:DesignWidth="450" - mc:Ignorable="d"> - - <Grid x:Name="LayoutRoot" Background="White"> - - <Grid.RowDefinitions> - <RowDefinition Height="30" /> - <RowDefinition Height="30" /> - <RowDefinition Height="30" /> - <RowDefinition Height="30" /> - <RowDefinition Height="30" /> - <RowDefinition Height="30" /> - <RowDefinition Height="50" /> - <RowDefinition Height="150" /> - </Grid.RowDefinitions> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="*" /> - <ColumnDefinition Width="100" /> - <ColumnDefinition Width="300" /> - <ColumnDefinition Width="30" /> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - - <TextBlock Grid.Row="1" - Grid.Column="1" - Style="{StaticResource LabelStyle}" - Text="Username:" /> - - <TextBox x:Name="tbUsername" - Grid.Row="1" - Grid.Column="2" - LostFocus="tbUsername_LostFocus" - Style="{StaticResource TextBoxStyle}" - Text="{Binding Username, - Mode=TwoWay, - ValidatesOnNotifyDataErrors=True, - NotifyOnValidationError=True}" /> - - <sdk:DescriptionViewer Grid.Row="1" - Grid.Column="3" - Width="20" - Description="Required" - Target="{Binding ElementName=tbUsername}" /> - - <TextBlock Grid.Row="2" - Grid.Column="1" - Style="{StaticResource LabelStyle}" - Text="Password:" /> - - <PasswordBox x:Name="tbPassword" - Grid.Row="2" - Grid.Column="2" - LostFocus="tbPassword_LostFocus" - Password="{Binding Password, - Mode=TwoWay, - ValidatesOnNotifyDataErrors=True, - NotifyOnValidationError=True}" - Style="{StaticResource PasswordBoxStyle}" /> - - <sdk:DescriptionViewer Grid.Row="2" - Grid.Column="3" - Width="20" - Description="Required" - Target="{Binding ElementName=tbPassword}" /> - - <TextBlock Grid.Row="3" - Grid.Column="1" - Style="{StaticResource LabelStyle}" - Text="Email:" /> - - <TextBox x:Name="tbEmail" - Grid.Row="3" - Grid.Column="2" - LostFocus="tbEmail_LostFocus" - Style="{StaticResource TextBoxStyle}" - Text="{Binding Email, - Mode=TwoWay, - ValidatesOnNotifyDataErrors=True, - NotifyOnValidationError=True}" /> - - <sdk:DescriptionViewer Grid.Row="3" - Grid.Column="3" - Width="20" - Description="Required" - Target="{Binding ElementName=tbEmail}" /> - - <TextBlock Grid.Row="4" - Grid.Column="1" - Style="{StaticResource LabelStyle}" - Text="Date of Birth:" /> - - <sdk:DatePicker x:Name="dpDateOfBirth" - Grid.Row="4" - Grid.Column="2" - KeyDown="DatePicker_KeyDown" - LostFocus="dpDateOfBirth_LostFocus" - SelectedDate="{Binding DateOfBirth, - Mode=TwoWay, - ValidatesOnNotifyDataErrors=True, - NotifyOnValidationError=True}" - Style="{StaticResource DatePickerStyle}" /> - <sdk:DescriptionViewer Grid.Row="4" - Grid.Column="3" - Width="20" - Description="Required" - Target="{Binding ElementName=dpDateOfBirth}" /> - - <TextBlock x:Name="tbDescription" - Grid.Row="5" - Grid.Column="1" - Style="{StaticResource LabelStyle}" - Text="Description:" /> - - <TextBox Grid.Row="5" - Grid.Column="2" - Style="{StaticResource TextBoxStyle}" - Text="{Binding Description}" /> - <StackPanel Grid.Row="6" - Grid.Column="2" - HorizontalAlignment="Right" - Orientation="Horizontal"> - <Button Command="{Binding OkCommand}" - Content="OK" - Style="{StaticResource ButtonStyle}" /> - <Button Command="{Binding CancelCommand}" - Content="Cancel" - Style="{StaticResource ButtonStyle}" /> - </StackPanel> - - <sdk:ValidationSummary Grid.Row="7" - Grid.Column="1" - Grid.ColumnSpan="2" - Style="{StaticResource ValidationSummaryStyle}" /> - - </Grid> -</UserControl>
--- a/delete me/SilverlightValidation/Views/UserView.xaml.cs Tue Apr 24 00:53:56 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -using System.Windows; -using System.Windows.Browser; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Input; -using SilverlightValidation.ViewModels; -using SilverlightValidation.Models; -using SilverlightValidation.Validators; - -namespace SilverlightValidation.Views -{ - public partial class UserView - { - private UserViewModel vm; - public UserView() - { - InitializeComponent(); - HtmlPage.Document.SetProperty("title", "Silverlight Validation"); - - vm = new UserViewModel(UserModel.Create(), new UserModelValidator()); - this.DataContext = vm; - } - - private static void UpdateTextBoxSource(object sender) - { - BindingExpression be = ((TextBox)sender).GetBindingExpression(TextBox.TextProperty); - be.UpdateSource(); - } - - private void DatePicker_KeyDown(object sender, KeyEventArgs e) - { - if (e.Key != Key.Tab) - e.Handled = true; - } - - private void tbUsername_LostFocus(object sender, RoutedEventArgs e) - { - UpdateTextBoxSource(sender); - } - - private void tbPassword_LostFocus(object sender, RoutedEventArgs e) - { - BindingExpression be = ((PasswordBox)sender).GetBindingExpression(PasswordBox.PasswordProperty); - be.UpdateSource(); - } - - private void tbEmail_LostFocus(object sender, RoutedEventArgs e) - { - UpdateTextBoxSource(sender); - } - - private void dpDateOfBirth_LostFocus(object sender, RoutedEventArgs e) - { - BindingExpression be = ((DatePicker)sender).GetBindingExpression(DatePicker.SelectedDateProperty); - be.UpdateSource(); - } - } -} \ No newline at end of file