-
Notifications
You must be signed in to change notification settings - Fork 0
/
WindowHolder.cs
123 lines (107 loc) · 4.07 KB
/
WindowHolder.cs
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
using Job_Application_Database.Enum;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace Job_Application_Database
{
/// <summary>
/// Base Class For Any Class That Holds A Window Object
/// </summary>
public abstract class BaseWindow
{
/// <summary>
/// Reference To The Window
/// </summary>
protected Window Window { get; set; }
/// <summary>
/// The Title Of The Window
/// </summary>
protected string Title { get; set; }
/// <summary>
/// Will Come Back To this
/// </summary>
public abstract ExitStatus Exit { get; set; }
/// <summary>
/// Default Constructor
/// </summary>
public BaseWindow(Window window, string title)
{
Window = window;
Window.Title = title;
Window.Loaded += Window_Loaded;
Window.Closing += Window_Closing;
Window.KeyDown += Window_KeyDown;
}
/// <summary>
/// Delegated Window Loaded Event Method
/// </summary>
/// <param name="sender">The Object That Called Triggered This Event</param>
/// <param name="e">The Event Arguments</param>
protected virtual void Window_Loaded(object sender, RoutedEventArgs e)
{
throw new NotImplementedException();
}
/// <summary>
/// Delegated Window Closing Event Method
/// </summary>
/// <param name="sender">The Object That Called Triggered This Event</param>
/// <param name="e">The Event Arguments</param>
protected virtual void Window_Closing(object sender, CancelEventArgs e)
{
throw new NotImplementedException();
}
/// <summary>
/// Delegated Window Key Down Event Method
/// </summary>
/// <param name="sender">The Object That Called Triggered This Event</param>
/// <param name="e">The Event Arguments</param>
protected virtual void Window_KeyDown(object sender, KeyEventArgs e)
{
throw new NotImplementedException();
}
/// <summary>
/// Delegated Element Click Event Method
/// </summary>
/// <param name="sender">The Object That Called Triggered This Event</param>
/// <param name="e">The Event Arguments</param>
protected virtual void Element_Click(object sender, RoutedEventArgs e) { }
/// <summary>
/// Delegated Element Double Click Event Method
/// </summary>
/// <param name="sender">The Object That Called Triggered This Event</param>
/// <param name="e">The Event Arguments</param>
protected virtual void Element_DoubleClick(object sender, MouseButtonEventArgs e) { }
/// <summary>
/// Delegated Element Text Changed Event Method
/// </summary>
/// <param name="sender">The Object That Called Triggered This Event</param>
/// <param name="e">The Event Arguments</param>
protected virtual void Element_TextChanged(object sender, TextChangedEventArgs e) { }
/// <summary>
/// Delegated Element Focus Changed Event Method
/// </summary>
/// <param name="sender">The Object That Called Triggered This Event</param>
/// <param name="e">The Event Arguments</param>
protected virtual void Element_FocusChanged(object sender, RoutedEventArgs e) { }
/// <summary>
/// Delegate Element Mouse Down Event Method
/// </summary>
/// <param name="sender">The Object That Called Triggered This Event</param>
/// <param name="e">The Event Arguments</param>
protected virtual void Element_MouseDown(object sender, MouseEventArgs e) { }
public void ShowDialog()
{
Window.ShowDialog();
}
public void Show()
{
Window.Show();
}
}
}