@@ -73,9 +73,21 @@ namespace Epoxy;
73
73
/// <example>
74
74
/// <code>
75
75
/// // Declared a Well into the ViewModel.
76
- /// this.ReadyWell = Well.Factory.Create<Window>("Loaded", async () =>
76
+ /// public Well<Window> WindowWell = Well.Factory.Create<Window>();
77
+ ///
78
+ /// // ...
79
+ ///
80
+ /// public MainWindowViewModel()
77
81
/// {
78
- /// // Event received.
82
+ /// this.WindowWell.Add(Window.Loaded, () =>
83
+ /// {
84
+ /// // Event received.
85
+ /// });
86
+ ///
87
+ /// this.WindowWell.Add<KeyEventArgs>("KeyDown", e =>
88
+ /// {
89
+ /// // Event received.
90
+ /// });
79
91
/// });
80
92
/// </code>
81
93
/// </example>
@@ -88,6 +100,12 @@ public static class WellExtension
88
100
/// <typeparam name="TUIElement">Target control type</typeparam>
89
101
/// <param name="factory">Factory instance (not used)</param>
90
102
/// <returns>Well instance</returns>
103
+ /// <example>
104
+ /// <code>
105
+ /// // Declared a Well into the ViewModel.
106
+ /// public Well<Window> WindowWell = Well.Factory.Create<Window>();
107
+ /// </code>
108
+ /// </example>
91
109
public static Well < TUIElement > Create < TUIElement > (
92
110
this WellFactoryInstance factory )
93
111
where TUIElement : UIElement =>
@@ -102,6 +120,17 @@ public static Well<TUIElement> Create<TUIElement>(
102
120
/// <param name="well">Well</param>
103
121
/// <param name="eventName">Event name</param>
104
122
/// <param name="action">Action delegate</param>
123
+ /// <example>
124
+ /// <code>
125
+ /// public MainWindowViewModel()
126
+ /// {
127
+ /// this.WindowWell.Add<KeyEventArgs>("KeyDown", e =>
128
+ /// {
129
+ /// // Event received.
130
+ /// });
131
+ /// });
132
+ /// </code>
133
+ /// </example>
105
134
public static void Add < TEventArgs > (
106
135
this Well well ,
107
136
string eventName ,
@@ -114,6 +143,17 @@ public static void Add<TEventArgs>(
114
143
/// <param name="well">Well</param>
115
144
/// <param name="eventName">Event name</param>
116
145
/// <param name="action">Action delegate</param>
146
+ /// <example>
147
+ /// <code>
148
+ /// public MainWindowViewModel()
149
+ /// {
150
+ /// this.WindowWell.Add("Loaded", () =>
151
+ /// {
152
+ /// // Event received.
153
+ /// });
154
+ /// });
155
+ /// </code>
156
+ /// </example>
117
157
public static void Add (
118
158
this Well well ,
119
159
string eventName ,
@@ -138,6 +178,17 @@ public static void Remove(
138
178
/// <param name="well">Well</param>
139
179
/// <param name="routedEvent">RoutedEvent</param>
140
180
/// <param name="action">Action delegate</param>
181
+ /// <example>
182
+ /// <code>
183
+ /// public MainWindowViewModel()
184
+ /// {
185
+ /// this.WindowWell.Add(DragDrop.DragEnter, e =>
186
+ /// {
187
+ /// // Event received.
188
+ /// });
189
+ /// });
190
+ /// </code>
191
+ /// </example>
141
192
public static void Add < TEventArgs > (
142
193
this Well well ,
143
194
#if AVALONIA || AVALONIA11
@@ -155,6 +206,17 @@ public static void Add<TEventArgs>(
155
206
/// <param name="well">Well</param>
156
207
/// <param name="routedEvent">RoutedEvent</param>
157
208
/// <param name="action">Action delegate</param>
209
+ /// <example>
210
+ /// <code>
211
+ /// public MainWindowViewModel()
212
+ /// {
213
+ /// this.WindowWell.Add(Window.Loaded, () =>
214
+ /// {
215
+ /// // Event received.
216
+ /// });
217
+ /// });
218
+ /// </code>
219
+ /// </example>
158
220
public static void Add (
159
221
this Well well ,
160
222
RoutedEvent routedEvent ,
0 commit comments