2017-09-12 14:32:34 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
using ChatController.Klassen;
|
|
|
|
|
|
|
|
|
|
|
|
using Point = System.Windows.Point;
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-09-15 16:39:07 +02:00
|
|
|
|
namespace ownChat
|
2017-09-12 14:32:34 +02:00
|
|
|
|
{
|
2019-04-02 13:43:30 +02:00
|
|
|
|
public partial class MainWindow
|
2017-09-12 14:32:34 +02:00
|
|
|
|
{
|
2019-04-02 13:43:30 +02:00
|
|
|
|
private readonly ChatEmojisView _EmojiView;
|
2017-09-12 14:32:34 +02:00
|
|
|
|
|
|
|
|
|
|
public MainWindow(ChatDatenUebergabe x)
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
|
|
ChatMainControl.InitMitChatdaten(x);
|
2019-04-02 13:43:30 +02:00
|
|
|
|
ChatMainControl.ResetStyle();
|
2017-10-06 12:08:05 +02:00
|
|
|
|
|
2019-04-02 13:43:30 +02:00
|
|
|
|
_EmojiView = new ChatEmojisView(ChatMainControl);
|
2017-09-12 14:32:34 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ChatMainControl_OnOnEmojii(System.Windows.Controls.Button emojiButton)
|
|
|
|
|
|
{
|
2019-04-02 13:43:30 +02:00
|
|
|
|
_EmojiView.Visibility = Visibility.Visible;
|
2017-09-12 14:32:34 +02:00
|
|
|
|
|
2019-04-02 13:43:30 +02:00
|
|
|
|
var pointToScreen = emojiButton.PointToScreen(new Point(0, 0));
|
|
|
|
|
|
var presentationSource = PresentationSource.FromVisual(emojiButton);
|
2017-09-12 14:32:34 +02:00
|
|
|
|
|
2019-04-02 13:43:30 +02:00
|
|
|
|
if(presentationSource?.CompositionTarget != null)
|
2017-09-12 14:32:34 +02:00
|
|
|
|
{
|
2019-04-02 13:43:30 +02:00
|
|
|
|
_EmojiView.Top = pointToScreen.Y / presentationSource.CompositionTarget.TransformToDevice.M22 - _EmojiView.Height - 5;
|
|
|
|
|
|
_EmojiView.Left = pointToScreen.X / presentationSource.CompositionTarget.TransformToDevice.M11 - 270;
|
2017-09-12 14:32:34 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-09-15 09:49:32 +02:00
|
|
|
|
|
2017-09-20 11:46:00 +02:00
|
|
|
|
private void MainWindow_OnClosed(object sender, EventArgs e)
|
2017-09-18 13:07:37 +02:00
|
|
|
|
{
|
2017-11-07 11:56:29 +01:00
|
|
|
|
ChatMainControl.SpeichereMessageInfoInDatei();
|
|
|
|
|
|
Environment.Exit(0);
|
2017-10-06 12:08:05 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ChatMainControl_OnOnClose()
|
2017-10-24 12:44:15 +02:00
|
|
|
|
{
|
|
|
|
|
|
ChatMainControl.SpeichereMessageInfoInDatei();
|
|
|
|
|
|
Environment.Exit(0);
|
2017-09-18 13:07:37 +02:00
|
|
|
|
}
|
2017-09-12 14:32:34 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|