-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjectItem.xaml.cs
More file actions
88 lines (74 loc) · 2.83 KB
/
Copy pathProjectItem.xaml.cs
File metadata and controls
88 lines (74 loc) · 2.83 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
using System.Windows;
using Forms = System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Controls;
using System.Windows.Media;
namespace Pin
{
/// <summary>
/// Interaction logic for ProjectItem.xaml
/// </summary>
public partial class ProjectItem : UserControl
{
public ProjectViewModel DataModel { get; set; }
public ProjectItem(ProjectViewModel project)
{
DataContext = DataModel = project;
InitializeComponent();
UI_ColorSelectionBox.FillColor = project.Project.Color;
}
public ProjectItem()
{
DataContext = DataModel = new ProjectViewModel(new Model.Project("Blah","Blah",new SolidColorBrush(Colors.Blue)));
InitializeComponent();
UI_ColorSelectionBox.FillColor = new System.Windows.Media.SolidColorBrush(Colors.Red);
}
private void UI_OpenWithExplorer_Click(object sender, RoutedEventArgs e)
{
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo("explorer.exe", DataModel.ProjectPath));
}
private void UI_Btn_Save_Click(object sender, RoutedEventArgs e)
{
DataModel.FillColor = UI_ColorSelectionBox.FillColor;
DataModel.SaveProperties();
UI_Btn_Cancel_Click(sender, e); // revert to previous state
}
private void UI_Btn_Browse_Click(object sender, RoutedEventArgs e)
{
Forms.FolderBrowserDialog path = new Forms.FolderBrowserDialog();
path.ShowDialog();
// change current version
DataModel.ProjectPath = path.SelectedPath;
}
private void UI_Btn_Cancel_Click(object sender, RoutedEventArgs e)
{
UI_Grid_View.Visibility = Visibility.Visible;
UI_Grid_Edit.Visibility = Visibility.Hidden;
}
private void UI_MenuItem_Edit_Click(object sender, RoutedEventArgs e)
{
UI_Grid_Edit.Visibility = Visibility.Visible;
UI_Grid_View.Visibility = Visibility.Hidden;
}
private void UI_ContextMenu_Opened(object sender, RoutedEventArgs e)
{
MouseOverController.isMouseOverMenu = true;
}
private void UI_ContextMenu_Closed(object sender, RoutedEventArgs e)
{
MouseOverController.isMouseOverMenu = false;
}
private void UI_ContextMenu_MouseEnter(object sender, MouseEventArgs e)
{
MouseOverController.isMouseOverMenu = true;
}
private void UI_ContextMenu_MouseLeave(object sender, MouseEventArgs e)
{
MouseOverController.isMouseOverMenu = false;
}
private void UI_MenuItem_Delete_Click(object sender, RoutedEventArgs e)
{
DataModel.DeleteProperties();
}
}
}