@@ -20,8 +20,11 @@ namespace Debugger
2020 /// The config class.
2121 /// Only used for Data that is permanent and saved
2222 /// </summary>
23- public class Config : ObservableObject
23+ public class Config : ViewModelBase
2424 {
25+ private long _maxFileSize = 5 * 1024 * 1024 ; // Default: 5 MB
26+ private int _maxFileCount = 10 ; // Default: 10
27+
2528 /// <summary>
2629 /// Gets or sets the debug path.
2730 /// </summary>
@@ -30,8 +33,9 @@ public string DebugPath
3033 get => DebugRegister . DebugPath ;
3134 set
3235 {
36+ if ( DebugRegister . DebugPath == value ) return ;
3337 DebugRegister . DebugPath = value ;
34- RaisePropertyChangedEvent ( nameof ( DebugPath ) ) ;
38+ OnPropertyChanged ( ) ;
3539 }
3640 }
3741
@@ -43,8 +47,9 @@ public int SecondsTick
4347 get => DebugRegister . SecondsTick ;
4448 set
4549 {
50+ if ( DebugRegister . SecondsTick == value ) return ;
4651 DebugRegister . SecondsTick = value ;
47- RaisePropertyChangedEvent ( nameof ( SecondsTick ) ) ;
52+ OnPropertyChanged ( ) ;
4853 }
4954 }
5055
@@ -56,8 +61,9 @@ public int MinutesTick
5661 get => DebugRegister . MinutesTick ;
5762 set
5863 {
64+ if ( DebugRegister . MinutesTick == value ) return ;
5965 DebugRegister . MinutesTick = value ;
60- RaisePropertyChangedEvent ( nameof ( MinutesTick ) ) ;
66+ OnPropertyChanged ( ) ;
6167 }
6268 }
6369
@@ -69,8 +75,9 @@ public int HourTick
6975 get => DebugRegister . HourTick ;
7076 set
7177 {
78+ if ( DebugRegister . HourTick == value ) return ;
7279 DebugRegister . HourTick = value ;
73- RaisePropertyChangedEvent ( nameof ( HourTick ) ) ;
80+ OnPropertyChanged ( ) ;
7481 }
7582 }
7683
@@ -82,26 +89,43 @@ public bool IsDumpActive
8289 get => DebugRegister . IsDumpActive ;
8390 set
8491 {
92+ if ( DebugRegister . IsDumpActive == value ) return ;
8593 DebugRegister . IsDumpActive = value ;
86- RaisePropertyChangedEvent ( nameof ( IsDumpActive ) ) ;
94+ OnPropertyChanged ( ) ;
8795 }
8896 }
8997
9098 /// <summary>
9199 /// Gets or sets a value indicating whether this instance is verbose.
92100 /// </summary>
93- /// <value>
94- /// <c>true</c> if this instance is verbose; otherwise, <c>false</c>.
95- /// </value>
96101 public bool IsVerbose
97102 {
98103 get => DebugRegister . IsVerbose ;
99104 set
100105 {
106+ if ( DebugRegister . IsVerbose == value ) return ;
101107 DebugRegister . IsVerbose = value ;
102- RaisePropertyChangedEvent ( nameof ( IsVerbose ) ) ;
108+ OnPropertyChanged ( ) ;
103109 }
104110 }
111+
112+ /// <summary>
113+ /// Maximum size for each log file in bytes.
114+ /// </summary>
115+ public long MaxFileSize
116+ {
117+ get => _maxFileSize ;
118+ set => SetProperty ( ref _maxFileSize , value ) ;
119+ }
120+
121+ /// <summary>
122+ /// Maximum number of log files to retain.
123+ /// </summary>
124+ public int MaxFileCount
125+ {
126+ get => _maxFileCount ;
127+ set => SetProperty ( ref _maxFileCount , value ) ;
128+ }
105129 }
106130
107131 /// <inheritdoc />
@@ -119,8 +143,9 @@ public bool SuppressWindow
119143 get => DebugRegister . SuppressWindow ;
120144 set
121145 {
146+ if ( DebugRegister . SuppressWindow == value ) return ;
122147 DebugRegister . SuppressWindow = value ;
123- RaisePropertyChangedEvent ( nameof ( SuppressWindow ) ) ;
148+ OnPropertyChanged ( ) ;
124149 }
125150 }
126151
@@ -130,10 +155,11 @@ public bool SuppressWindow
130155 public bool IsRunning
131156 {
132157 get => DebugRegister . IsRunning ;
133- init
158+ set
134159 {
160+ if ( DebugRegister . IsRunning == value ) return ;
135161 DebugRegister . IsRunning = value ;
136- RaisePropertyChangedEvent ( nameof ( IsRunning ) ) ;
162+ OnPropertyChanged ( ) ;
137163 }
138164 }
139165
@@ -145,8 +171,9 @@ public string ErrorColor
145171 get => DebugRegister . ErrorColor ;
146172 set
147173 {
174+ if ( DebugRegister . ErrorColor == value ) return ;
148175 DebugRegister . ErrorColor = value ;
149- RaisePropertyChangedEvent ( nameof ( ErrorColor ) ) ;
176+ OnPropertyChanged ( ) ;
150177 }
151178 }
152179
@@ -158,8 +185,9 @@ public string WarningColor
158185 get => DebugRegister . WarningColor ;
159186 set
160187 {
188+ if ( DebugRegister . WarningColor == value ) return ;
161189 DebugRegister . WarningColor = value ;
162- RaisePropertyChangedEvent ( nameof ( WarningColor ) ) ;
190+ OnPropertyChanged ( ) ;
163191 }
164192 }
165193
@@ -171,8 +199,9 @@ public string InformationColor
171199 get => DebugRegister . InformationColor ;
172200 set
173201 {
202+ if ( DebugRegister . InformationColor == value ) return ;
174203 DebugRegister . InformationColor = value ;
175- RaisePropertyChangedEvent ( nameof ( InformationColor ) ) ;
204+ OnPropertyChanged ( ) ;
176205 }
177206 }
178207
@@ -184,8 +213,9 @@ public string ExternalColor
184213 get => DebugRegister . ExternalColor ;
185214 set
186215 {
216+ if ( DebugRegister . ExternalColor == value ) return ;
187217 DebugRegister . ExternalColor = value ;
188- RaisePropertyChangedEvent ( nameof ( ExternalColor ) ) ;
218+ OnPropertyChanged ( ) ;
189219 }
190220 }
191221
@@ -197,35 +227,24 @@ public string StandardColor
197227 get => DebugRegister . StandardColor ;
198228 set
199229 {
230+ if ( DebugRegister . StandardColor == value ) return ;
200231 DebugRegister . StandardColor = value ;
201- RaisePropertyChangedEvent ( nameof ( StandardColor ) ) ;
232+ OnPropertyChanged ( ) ;
202233 }
203234 }
204235
205236 /// <summary>
206237 /// Gets or sets the color options.
207238 /// </summary>
208- /// <value>
209- /// The color options.
210- /// </value>
211239 public List < ColorOption > ColorOptions
212240 {
213241 get => DebugRegister . ColorOptions ;
214242 set
215243 {
244+ if ( DebugRegister . ColorOptions == value ) return ;
216245 DebugRegister . ColorOptions = value ;
217- RaisePropertyChangedEvent ( nameof ( ColorOptions ) ) ;
246+ OnPropertyChanged ( ) ;
218247 }
219248 }
220-
221- /// <summary>
222- /// Maximum size for each log file in bytes.
223- /// </summary>
224- public long MaxFileSize { get ; set ; } = 5 * 1024 * 1024 ; // Default: 5 MB
225-
226- /// <summary>
227- /// Maximum number of log files to retain.
228- /// </summary>
229- public int MaxFileCount { get ; set ; } = 10 ; // Default: 10
230249 }
231250}
0 commit comments