-
Notifications
You must be signed in to change notification settings - Fork 9
/
IView.cs
87 lines (73 loc) · 2.65 KB
/
IView.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
namespace HanumanInstitute.MvvmDialogs;
/// <summary>
/// Interface describing a generic window.
/// </summary>
/// <remarks>
/// This interface allows cross-platform support, and allows for custom windows
/// not deriving from the standard types.
/// </remarks>
public interface IView
{
/// <summary>
/// Initializes the <see cref="IView"/> from specified view model and view type.
/// </summary>
/// <param name="viewModel">The view model to display.</param>
/// <param name="viewDef">The view definition including its type and how to create one.</param>
void Initialize(INotifyPropertyChanged viewModel, ViewDefinition viewDef);
/// <summary>
/// Initializes the <see cref="IView"/> from specified view model and existing view.
/// </summary>
/// <param name="viewModel">The view model to display.</param>
/// <param name="view">The view to display.</param>
void InitializeExisting(INotifyPropertyChanged viewModel, object view);
/// <summary>
/// Gets the Window reference held by this class.
/// </summary>
public object RefObj { get; }
/// <summary>
/// Occurs when the window is loaded.
/// </summary>
event EventHandler Loaded;
/// <summary>
/// Occurs when the window is closing.
/// </summary>
event EventHandler<CancelEventArgs> Closing;
/// <summary>
/// Occurs when the window is closed.
/// </summary>
event EventHandler Closed;
/// <summary>
/// Gets or sets the data context for an element when it participates in data binding.
/// </summary>
INotifyPropertyChanged? ViewModel { get; }
/// <summary>
/// Opens a window and returns without waiting for the newly opened window to close.
/// </summary>
void Show(IView? owner);
/// <summary>
/// Opens a window and returns only when the newly opened window is closed.
/// </summary>
/// <returns>
/// A <see cref="Nullable{Boolean}"/> value that specifies whether the activity was accepted (true) or canceled (false).</returns>
Task ShowDialogAsync(IView owner);
/// <summary>
/// Tries to activate the Window.
/// </summary>
void Activate();
/// <summary>
/// Tries to close the Window.
/// </summary>
void Close();
/// <summary>
/// Gets or sets whether the window is enabled.
/// </summary>
bool IsEnabled { get; set; }
/// <summary>
/// Gets whether the window is visible.
/// </summary>
bool IsVisible { get; }
/// <summary>
/// Gets or sets whether closing has been confirmed, in which case Closing event should be ignored.
/// </summary>
bool ClosingConfirmed { get; set; }
}