-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml.cs
More file actions
50 lines (43 loc) · 1.49 KB
/
Copy pathMainWindow.xaml.cs
File metadata and controls
50 lines (43 loc) · 1.49 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
48
49
50
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
using AdvancedColorPicker.Models;
using AdvancedColorPicker.Properties;
using AdvancedColorPicker.ViewModels;
namespace AdvancedColorPicker
{
/// <summary>
/// MainWindow.xaml etkileşim mantığı
/// </summary>
public partial class MainWindow
{
public static MainWindow Instance;
public MainWindow()
{
InitializeComponent();
DataContext = new MainWindowViewModel();
Instance = this;
if (Settings.Default.ColorHistory == null)
Settings.Default.ColorHistory = new ColorHistoryCollection();
if (Settings.Default.Themes == null)
Settings.Default.Themes =
new ThemeCollection();
Closing += delegate
{
Settings.Default.Save();
};
}
private void UIElement_OnPreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
//until we had a StaysOpen glag to Drawer, this will help with scroll bars
var dependencyObject = Mouse.Captured as DependencyObject;
while (dependencyObject != null)
{
if (dependencyObject is ScrollBar) return;
dependencyObject = VisualTreeHelper.GetParent(dependencyObject);
}
MenuToggleButton.IsChecked = false;
}
}
}