Skip to content

Merge fix-autodisconnect-shellapps into develop #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Plugin.SegmentedControl.Maui/Utils/HandlerCleanUpHelper.cs
Original file line number Diff line number Diff line change
@@ -109,7 +109,7 @@ private static IEnumerable<Page> GetActivePages(Shell shell)
}
}

return hashSet;
return hashSet.Where(p => p != null);
}

private static IEnumerable<Page> WalkToPage(Element element)
@@ -125,7 +125,10 @@ private static IEnumerable<Page> WalkToPage(Element element)
case ShellSection shellSection:
IShellSectionController controller = shellSection;
var children = controller.GetItems().OfType<IShellContentController>();
return children.Select(c => c.Page);
var childPages = children
.Select(c => c.Page)
.SelectMany(p => PageHelper.GetNavigationTree(p));
return childPages;
}

return [];
5 changes: 5 additions & 0 deletions Plugin.SegmentedControl.Maui/Utils/PageHelper.cs
Original file line number Diff line number Diff line change
@@ -33,6 +33,11 @@ private static string PrintNavigationPath(IEnumerable<Page> pages)

internal static IEnumerable<Page> GetNavigationTree(Page page, bool modal = false)
{
if (page == null)
{
yield break;
}

var navigation = page.Navigation;

switch (page)
13 changes: 8 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@ trigger:
- Docs/*

variables:
solution: 'Plugin.SegmentedControl.Maui.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
majorVersion: 1
@@ -96,19 +95,23 @@ steps:
displayName: 'NuGet restore'
inputs:
command: restore
projects: '$(solution)'
projects: |
Plugin.SegmentedControl.Maui/**/*.csproj
Tests/**/*.Tests.csproj

- task: DotNetCoreCLI@2
displayName: 'Build solution'
displayName: 'Build projects'
inputs:
projects: '$(solution)'
projects: |
Plugin.SegmentedControl.Maui/**/*.csproj
Tests/**/*.Tests.csproj
arguments: '--no-restore --configuration $(buildConfiguration)'

- task: DotNetCoreCLI@2
displayName: 'Run UnitTests'
inputs:
command: test
projects: '**/*.Tests.csproj'
projects: 'Tests/**/*.Tests.csproj'
arguments: '--no-restore --no-build --configuration $(buildConfiguration) /p:CollectCoverage=true /p:Exclude="[Microsoft*]*%2C[Mono*]*%2C[xunit*]*%2C[*.Testdata]*" /p:CoverletOutput=UnitTests.coverage.cobertura.xml /p:MergeWith=$(Build.SourcesDirectory)/Tests/CoverletOutput/coverage.json /p:CoverletOutputFormat=cobertura'

- task: reportgenerator@5