@@ -310,6 +310,10 @@ public AfterViewEventData(IView view, ViewContext viewContext)
310
310
/// </summary>
311
311
public sealed class ViewFoundEventData : EventData
312
312
{
313
+ // Reuse boxed object for common values
314
+ private static readonly object BoxedTrue = true ;
315
+ private static readonly object BoxedFalse = false ;
316
+
313
317
/// <summary>
314
318
/// The name of the event.
315
319
/// </summary>
@@ -364,7 +368,7 @@ public ViewFoundEventData(ActionContext actionContext, bool isMainPage, ActionRe
364
368
protected override KeyValuePair < string , object > this [ int index ] => index switch
365
369
{
366
370
0 => new KeyValuePair < string , object > ( nameof ( ActionContext ) , ActionContext ) ,
367
- 1 => new KeyValuePair < string , object > ( nameof ( IsMainPage ) , IsMainPage ) ,
371
+ 1 => new KeyValuePair < string , object > ( nameof ( IsMainPage ) , IsMainPage ? BoxedTrue : BoxedFalse ) ,
368
372
2 => new KeyValuePair < string , object > ( nameof ( Result ) , Result ) ,
369
373
3 => new KeyValuePair < string , object > ( nameof ( ViewName ) , ViewName ) ,
370
374
4 => new KeyValuePair < string , object > ( nameof ( View ) , View ) ,
@@ -377,6 +381,10 @@ public ViewFoundEventData(ActionContext actionContext, bool isMainPage, ActionRe
377
381
/// </summary>
378
382
public sealed class ViewNotFoundEventData : EventData
379
383
{
384
+ // Reuse boxed object for common values
385
+ private static readonly object BoxedTrue = true ;
386
+ private static readonly object BoxedFalse = false ;
387
+
380
388
/// <summary>
381
389
/// The name of the event.
382
390
/// </summary>
@@ -431,7 +439,7 @@ public ViewNotFoundEventData(ActionContext actionContext, bool isMainPage, Actio
431
439
protected override KeyValuePair < string , object > this [ int index ] => index switch
432
440
{
433
441
0 => new KeyValuePair < string , object > ( nameof ( ActionContext ) , ActionContext ) ,
434
- 1 => new KeyValuePair < string , object > ( nameof ( IsMainPage ) , IsMainPage ) ,
442
+ 1 => new KeyValuePair < string , object > ( nameof ( IsMainPage ) , IsMainPage ? BoxedTrue : BoxedFalse ) ,
435
443
2 => new KeyValuePair < string , object > ( nameof ( Result ) , Result ) ,
436
444
3 => new KeyValuePair < string , object > ( nameof ( ViewName ) , ViewName ) ,
437
445
4 => new KeyValuePair < string , object > ( nameof ( SearchedLocations ) , SearchedLocations ) ,
0 commit comments