diff --git a/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Presentation/SampleChooserViewMode.Properties.cs b/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Presentation/SampleChooserViewMode.Properties.cs index 8e4c19be4937..ef875754bf13 100644 --- a/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Presentation/SampleChooserViewMode.Properties.cs +++ b/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Presentation/SampleChooserViewMode.Properties.cs @@ -46,6 +46,7 @@ public partial class SampleChooserViewModel : System.ComponentModel.INotifyPrope private bool _contentAttachedToWindow; private bool _useFluentStyles; private bool _useDarkTheme; + private bool _manualTestsOnly; private object _contentPhone = null; private string _searchTerm = ""; @@ -134,6 +135,17 @@ public bool CategoryVisibility } } + public bool ManualTestsOnly + { + get => _manualTestsOnly; + set + { + _manualTestsOnly = value; + RaisePropertyChanged(); + RefreshSamples(); + } + } + public bool SampleVisibility { get => _sampleVisibility; diff --git a/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Presentation/SampleChooserViewModel.cs b/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Presentation/SampleChooserViewModel.cs index 023ad28d5d0f..131826e726c7 100644 --- a/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Presentation/SampleChooserViewModel.cs +++ b/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Presentation/SampleChooserViewModel.cs @@ -116,7 +116,7 @@ public SampleChooserViewModel(SampleChooserControl owner) InitializeCommands(); ObserveChanges(); - _categories = GetSamples(); + RefreshSamples(); if (_log.IsEnabled(LogLevel.Information)) { @@ -747,6 +747,11 @@ private static Assembly[] GetAllAssembies() #endif } + private void RefreshSamples() + { + Categories = GetSamples(); + } + /// /// This method retreives all the categories and sample contents associated with them throughout the app. /// @@ -756,7 +761,7 @@ private List GetSamples() var categories = from type in _allSamples let sampleAttribute = FindSampleAttribute(type.GetTypeInfo()) - where sampleAttribute != null + where sampleAttribute != null && (!_manualTestsOnly || sampleAttribute.IsManualTest) let content = GetContent(type.GetTypeInfo(), sampleAttribute) from category in content.Categories group content by category into contentByCategory diff --git a/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleChooserControl.xaml b/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleChooserControl.xaml index ff9ca45ef91a..79121ee6fb5c 100644 --- a/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleChooserControl.xaml +++ b/src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleChooserControl.xaml @@ -266,6 +266,7 @@ @@ -276,6 +277,11 @@ + + + + + + + + +