diff --git a/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleChooserContent.cs b/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleChooserContent.cs index 481f45b59f07..5d3e3c46667d 100644 --- a/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleChooserContent.cs +++ b/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleChooserContent.cs @@ -13,6 +13,8 @@ namespace SampleControl.Entities [DebuggerDisplay("{" + nameof(ControlName) + "}")] public partial class SampleChooserContent : INotifyPropertyChanged { + // Keep all property getters and setters public to avoid issues when serializing/deserializing recent samples + // See https://github.com/unoplatform/uno/issues/15059#issuecomment-1891551501 public string ControlName { get; set; } public Type ViewModelType { get; set; } public Type ControlType { get; set; } @@ -20,9 +22,9 @@ public partial class SampleChooserContent : INotifyPropertyChanged public string CategoriesString => Categories?.JoinBy(", "); public string Description { get; set; } public string QueryString => $"?sample={Categories.FirstOrDefault() ?? ""}/{ControlName}"; - public bool IgnoreInSnapshotTests { get; internal set; } - public bool IsManualTest { get; internal set; } - public bool UsesFrame { get; internal set; } + public bool IgnoreInSnapshotTests { get; set; } + public bool IsManualTest { get; set; } + public bool UsesFrame { get; set; } bool _isFavorite; public bool IsFavorite diff --git a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RatingControlTests/RatingControlPage.xaml b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RatingControlTests/RatingControlPage.xaml index 605c3f048d02..398b71e897fb 100644 --- a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RatingControlTests/RatingControlPage.xaml +++ b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RatingControlTests/RatingControlPage.xaml @@ -11,7 +11,8 @@ - + + diff --git a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RatingControlTests/RatingControlPage.xaml.cs b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RatingControlTests/RatingControlPage.xaml.cs index ef2abfe15196..3ff49a6cc49b 100644 --- a/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RatingControlTests/RatingControlPage.xaml.cs +++ b/src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RatingControlTests/RatingControlPage.xaml.cs @@ -118,12 +118,9 @@ DependencyObject SearchVisualTree(DependencyObject root, string name) return child; } - - protected -#if !WINAPPSDK - internal -#endif - override void OnNavigatingFrom(NavigatingCancelEventArgs e) + // Uno specific: Unlike WinUI, we unsubscribe on Unloaded because we don't get OnNavigatedFrom. + // See point #2 in https://github.com/unoplatform/uno/issues/15059#issuecomment-1891551501 + private void TestRatingControl_Unloaded(object sender, RoutedEventArgs e) { _dt.Tick -= DispatcherTimer_Tick; // prevent leaks since the dispatcher holds a pointer to this }