Files
Chat/ChatController/ExceptionViewControl.xaml.cs

47 lines
1.2 KiB
C#
Raw Normal View History

2023-03-03 21:23:48 +01:00
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);
}
}
}