diff Glimpse/Glimpse Controls/ExceptionsViewer.xaml.vb @ 59:3591c26bd63e

MVVMLight added
author Steven Hollidge <stevenhollidge@hotmail.com>
date Sat, 21 Apr 2012 19:20:28 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Glimpse/Glimpse Controls/ExceptionsViewer.xaml.vb	Sat Apr 21 19:20:28 2012 +0100
@@ -0,0 +1,34 @@
+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