Toasts – Diff between revs 27 and 32
?pathlinks?
Rev 27 | Rev 32 | |||
---|---|---|---|---|
Line 1... | Line 1... | |||
1 | using System; |
1 | using System; |
|
2 | using System.Collections.Generic; |
2 | using System.Collections.Generic; |
|
- | 3 | using System.ComponentModel; |
||
3 | using System.Drawing; |
4 | using System.Drawing; |
|
4 | using System.Linq; |
5 | using System.Linq; |
|
- | 6 | using System.Runtime.CompilerServices; |
||
5 | using System.Text; |
7 | using System.Text; |
|
6 | using System.Threading.Tasks; |
8 | using System.Threading.Tasks; |
|
Line 7... | Line 9... | |||
7 | |
9 | |
|
8 | namespace Toasts |
10 | namespace Toasts |
|
9 | { |
11 | { |
|
10 | public class ToastDisplayData |
12 | public class ToastDisplayData : INotifyPropertyChanged |
|
- | 13 | { |
||
- | 14 | private string _title; |
||
- | 15 | private string _body; |
||
- | 16 | private bool _enableChime; |
||
- | 17 | private byte[] _chime; |
||
- | 18 | private int _lingerTime; |
||
- | 19 | private Image _image; |
||
- | 20 | private string _content; |
||
11 | { |
21 | |
|
- | 22 | public string Title |
||
- | 23 | { |
||
- | 24 | get => _title; |
||
- | 25 | set |
||
- | 26 | { |
||
- | 27 | if (value == _title) return; |
||
- | 28 | _title = value; |
||
- | 29 | OnPropertyChanged(); |
||
- | 30 | } |
||
- | 31 | } |
||
12 | public string Title { get; set; } |
32 | |
|
- | 33 | public string Body |
||
- | 34 | { |
||
- | 35 | get => _body; |
||
- | 36 | set |
||
- | 37 | { |
||
- | 38 | if (value == _body) return; |
||
- | 39 | _body = value; |
||
- | 40 | OnPropertyChanged(); |
||
- | 41 | } |
||
- | 42 | } |
||
13 | public string Body { get; set; } |
43 | |
|
- | 44 | public bool EnableChime |
||
- | 45 | { |
||
- | 46 | get => _enableChime; |
||
- | 47 | set |
||
- | 48 | { |
||
- | 49 | if (value == _enableChime) return; |
||
- | 50 | _enableChime = value; |
||
- | 51 | OnPropertyChanged(); |
||
- | 52 | } |
||
- | 53 | } |
||
14 | public bool EnableChime { get; set; } |
54 | |
|
- | 55 | public byte[] Chime |
||
- | 56 | { |
||
- | 57 | get => _chime; |
||
- | 58 | set |
||
- | 59 | { |
||
- | 60 | if (Equals(value, _chime)) return; |
||
- | 61 | _chime = value; |
||
- | 62 | OnPropertyChanged(); |
||
- | 63 | } |
||
- | 64 | } |
||
15 | public byte[] Chime { get; set; } |
65 | |
|
- | 66 | public int LingerTime |
||
- | 67 | { |
||
- | 68 | get => _lingerTime; |
||
- | 69 | set |
||
- | 70 | { |
||
- | 71 | if (value == _lingerTime) return; |
||
- | 72 | _lingerTime = value; |
||
- | 73 | OnPropertyChanged(); |
||
- | 74 | } |
||
- | 75 | } |
||
16 | public int LingerTime { get; set; } |
76 | |
|
- | 77 | public Image Image |
||
- | 78 | { |
||
- | 79 | get => _image; |
||
- | 80 | set |
||
- | 81 | { |
||
- | 82 | if (Equals(value, _image)) return; |
||
- | 83 | _image = value; |
||
- | 84 | OnPropertyChanged(); |
||
- | 85 | } |
||
- | 86 | } |
||
17 | public Image Image { get; set; } |
87 | |
|
- | 88 | public string Content |
||
- | 89 | { |
||
- | 90 | get => _content; |
||
- | 91 | set |
||
- | 92 | { |
||
- | 93 | if (value == _content) return; |
||
- | 94 | _content = value; |
||
- | 95 | OnPropertyChanged(); |
||
- | 96 | } |
||
- | 97 | } |
||
- | 98 | |
||
- | 99 | public ToastDisplayData() |
||
- | 100 | { |
||
- | 101 | |
||
- | 102 | } |
||
- | 103 | |
||
- | 104 | public event PropertyChangedEventHandler PropertyChanged; |
||
- | 105 | |
||
- | 106 | protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) |
||
- | 107 | { |
||
- | 108 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
||
18 | public string Content { get; set; } |
109 | } |
|
19 | } |
110 | } |