|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Xomega.Framework;
using System.Globalization;
namespace AdventureWorks.Client.WPF
{
/// <summary>
/// Interaction logic for Errors.xaml
/// </summary>
public partial class Errors : Window
{
public static void Show(ErrorList errorList)
{
Errors wErr = new Errors();
wErr.lstErrors.ItemsSource = errorList.Errors;
wErr.Show();
}
public Errors()
{
InitializeComponent();
}
private void btnClose_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
class SeverityToBrushConverter : IValueConverter
{
public Brush Warning { get; set; }
public Brush Error { get; set; }
public Brush Critical { get; set; }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (ErrorSeverity.Warning.Equals(value)) return Warning;
else if (ErrorSeverity.Error.Equals(value)) return Error;
if (ErrorSeverity.Critical.Equals(value)) return Critical;
else return null;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return value;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Xomega Team is striving to increase productivity and development quality by utilizing Model Driven Development coupled with Code Generation and the best design practices for application development.
We provide MDD tools, code generators and frameworks for Visual Studio and .Net development.
Visit us at
http://www.xomega.net