Generelle Ausnahmenanzeige
This commit is contained in:
@@ -17,6 +17,9 @@ namespace ownChat
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var currentDomain = AppDomain.CurrentDomain;
|
||||
currentDomain.UnhandledException += ExceptionHandler;
|
||||
|
||||
ChatMainControl.ContainingWindow = this;
|
||||
|
||||
ChatMainControl.InitMitChatdaten(x);
|
||||
@@ -24,6 +27,13 @@ namespace ownChat
|
||||
_EmojiView = new ChatEmojisView(ChatMainControl);
|
||||
}
|
||||
|
||||
private void ExceptionHandler(object sender, UnhandledExceptionEventArgs args)
|
||||
{
|
||||
var exception = (Exception)args.ExceptionObject;
|
||||
|
||||
new ExceptionWindow(exception) { Owner = this }.Show();
|
||||
}
|
||||
|
||||
private void ChatMainControl_OnOnEmojii(System.Windows.Controls.Button emojiButton)
|
||||
{
|
||||
_EmojiView.Visibility = Visibility.Visible;
|
||||
@@ -31,11 +41,13 @@ namespace ownChat
|
||||
var pointToScreen = emojiButton.PointToScreen(new Point(0, 0));
|
||||
var presentationSource = PresentationSource.FromVisual(emojiButton);
|
||||
|
||||
if(presentationSource?.CompositionTarget != null)
|
||||
if(presentationSource?.CompositionTarget == null)
|
||||
{
|
||||
_EmojiView.Top = pointToScreen.Y / presentationSource.CompositionTarget.TransformToDevice.M22 - _EmojiView.Height - 5;
|
||||
_EmojiView.Left = pointToScreen.X / presentationSource.CompositionTarget.TransformToDevice.M11 - 270;
|
||||
return;
|
||||
}
|
||||
|
||||
_EmojiView.Top = pointToScreen.Y / presentationSource.CompositionTarget.TransformToDevice.M22 - _EmojiView.Height - 5;
|
||||
_EmojiView.Left = pointToScreen.X / presentationSource.CompositionTarget.TransformToDevice.M11 - 270;
|
||||
}
|
||||
|
||||
private void MainWindow_OnClosed(object sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user