Generelle Ausnahmenanzeige
This commit is contained in:
46
ChatController/ExceptionViewControl.xaml.cs
Normal file
46
ChatController/ExceptionViewControl.xaml.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows;
|
||||
|
||||
namespace ChatController
|
||||
{
|
||||
public partial class ExceptionViewControl : INotifyPropertyChanged
|
||||
{
|
||||
public event EventHandler OkButtonClicked;
|
||||
|
||||
private Exception _Exception;
|
||||
public Exception Exception
|
||||
{
|
||||
get => _Exception;
|
||||
set
|
||||
{
|
||||
_Exception = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public ExceptionViewControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = this;
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
private void OkButton_OnClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
OkButtonClicked?.Invoke(this, args);
|
||||
}
|
||||
|
||||
private void CopyToClipboardButton_OnClick(object sender, RoutedEventArgs args)
|
||||
{
|
||||
Clipboard.SetText(Exception.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user