using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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 Tango.Core.Commands;
using Tango.MachineStudio.UI.ViewModels;
namespace Tango.MachineStudio.UI.Windows
{
///
/// Interaction logic for ExceptionWindow.xaml
///
public partial class ExceptionWindow : Window
{
public ExceptionResolutions Resolution { get; set; }
public String Exception { get; set; }
public RelayCommand ResolveCommand { get; set; }
public ExceptionWindow()
{
InitializeComponent();
DataContext = this;
}
public ExceptionWindow(Exception ex, bool canReport) : this()
{
Exception = ex.FlattenException();
ResolveCommand = new RelayCommand(Resolve);
if (!canReport)
{
btnReport.Visibility = Visibility.Collapsed;
}
}
private void Resolve(ExceptionResolutions resolution)
{
Resolution = resolution;
Close();
}
}
}