|
3 | 3 | // Distributed under the MIT software license, see the accompanying |
4 | 4 | // file LICENCE or http://www.opensource.org/licenses/mit-license.php. |
5 | 5 |
|
| 6 | +using System; |
6 | 7 | using WatchOnlyBitcoinWallet.MVVM; |
7 | 8 |
|
8 | 9 | namespace WatchOnlyBitcoinWallet.ViewModels |
9 | 10 | { |
10 | 11 | public class ViewModelBase : InpcBase |
11 | 12 | { |
12 | | - /// <summary> |
13 | | - /// Used for changing the visibility of error message TextBox. |
14 | | - /// </summary> |
| 13 | + public event EventHandler? CLoseEvent; |
| 14 | + |
| 15 | + public void RaiseCloseEvent() => CLoseEvent?.Invoke(this, EventArgs.Empty); |
| 16 | + |
| 17 | + private bool _isErrVisible; |
15 | 18 | public bool IsErrorMsgVisible |
16 | 19 | { |
17 | | - get => isErrorMsgVisible; |
18 | | - private set => SetField(ref isErrorMsgVisible, value); |
| 20 | + get => _isErrVisible; |
| 21 | + private set => SetField(ref _isErrVisible, value); |
19 | 22 | } |
20 | | - private bool isErrorMsgVisible; |
21 | 23 |
|
22 | | - /// <summary> |
23 | | - /// String containing all the errors. |
24 | | - /// </summary> |
| 24 | + private string _errors = string.Empty; |
25 | 25 | public string Errors |
26 | 26 | { |
27 | | - get => errors; |
| 27 | + get => _errors; |
28 | 28 | set |
29 | 29 | { |
30 | | - if (SetField(ref errors, value)) |
| 30 | + if (SetField(ref _errors, value)) |
31 | 31 | { |
32 | 32 | IsErrorMsgVisible = !string.IsNullOrEmpty(value); |
33 | 33 | } |
34 | 34 | } |
35 | 35 | } |
36 | | - private string errors; |
37 | 36 |
|
38 | | - /// <summary> |
39 | | - /// Status, showing current action being performed. |
40 | | - /// </summary> |
| 37 | + private string _status = string.Empty; |
41 | 38 | public string Status |
42 | 39 | { |
43 | | - get => status; |
44 | | - set => SetField(ref status, value); |
| 40 | + get => _status; |
| 41 | + set => SetField(ref _status, value); |
45 | 42 | } |
46 | | - private string status; |
47 | | - |
48 | 43 | } |
49 | 44 | } |
0 commit comments