-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainWindow.xaml.cs
More file actions
42 lines (35 loc) · 1.06 KB
/
Copy pathMainWindow.xaml.cs
File metadata and controls
42 lines (35 loc) · 1.06 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
using System.Windows;
using System.Windows.Input;
using Desktoper.MVVM.View;
using Desktoper.Services;
namespace Desktoper
{
public partial class MainWindow
{
public Config Config => Config.Current;
public MainWindow()
{
InitializeComponent();
this.DataContext = this;
}
public void OpenPopup(object content, string title = null)
{
this.PopupHost.PopupContent = content;
PopupHost.Title.Text = title;
PopupHost.IsOpen = true;
}
private void OnDragMove(object sender, MouseButtonEventArgs e) => this.DragMove();
private void OnClosing(object sender, RoutedEventArgs e)
{
Close();
}
private void ListeningStateMouseDown(object sender, MouseButtonEventArgs e)
{
Config.Current.IsListening = !Config.Current.IsListening;
}
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
OpenPopup(new SettingsView(), "Settings");
}
}
}