-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml.cs
More file actions
47 lines (40 loc) · 1.18 KB
/
MainWindow.xaml.cs
File metadata and controls
47 lines (40 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System.Windows;
using System.Windows.Input;
namespace GraTechCommander;
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
DragMove();
}
private void Minimize_Click(object sender, RoutedEventArgs e)
{
WindowState = WindowState.Minimized;
}
private void Maximize_Click(object sender, RoutedEventArgs e)
{
WindowState = WindowState == WindowState.Maximized
? WindowState.Normal
: WindowState.Maximized;
}
private void Close_Click(object sender, RoutedEventArgs e)
{
Close();
}
private void Conversation_Click(object sender, MouseButtonEventArgs e)
{
// Handle conversation selection through binding
if (sender is FrameworkElement element && element.DataContext is Models.Conversation conv)
{
if (DataContext is ViewModels.MainViewModel vm)
{
vm.SelectConversationCommand.Execute(conv);
}
}
}
}