comparison SilverlightValidation/SilverlightGlimpse/Controls/ExceptionsViewer.xaml.cs @ 58:241e2f22ed3c

Latest version
author Steven Hollidge <stevenhollidge@hotmail.com>
date Sat, 21 Apr 2012 15:06:48 +0100
parents
children 3591c26bd63e
comparison
equal deleted inserted replaced
57:558c09d76726 58:241e2f22ed3c
1 using System;
2 using System.Windows;
3 using SilverlightGlimpse.Models;
4 using System.Windows.Controls;
5
6 namespace SilverlightGlimpse.Controls
7 {
8 public partial class ExceptionsViewer
9 {
10 public ExceptionsViewer()
11 {
12 InitializeComponent();
13 }
14
15 private void ClearExceptions_Click(object sender, RoutedEventArgs e)
16 {
17 GlimpseService.CreateInstance.HostExceptions.Clear();
18 }
19
20 private void ExceptionsViewer_Loaded(object sender, RoutedEventArgs e)
21 {
22 this.DataContext = GlimpseService.CreateInstance.HostExceptions;
23 if (GlimpseService.CreateInstance.HostExceptions.Count > 0)
24 this.lbExceptions.SelectedIndex = 0;
25 }
26
27 private void lbExceptions_SelectionChanged(object sender, SelectionChangedEventArgs e)
28 {
29 if (this.lbExceptions.SelectedItem != null && this.lbExceptions.SelectedItem is ExceptionWrapper)
30 {
31 if (((ExceptionWrapper)this.lbExceptions.SelectedItem).IsValidationException)
32 this.tbAction.Visibility = Visibility.Visible;
33 else
34 this.tbAction.Visibility = Visibility.Collapsed;
35 }
36 }
37 }
38 }