Repository navigation
Target .NET 10, fix selection and children bugs, add tests and release CI - #118
Merged
Merged
Conversation
…e CI Build - Library targets netstandard2.0 and net10.0; Xamarin.Forms 5.0.0.2662. - C# 14, .editorconfig style rules enforced at build time (Directory.Build.props); library and tests treat warnings as errors; XML docs required on public API. - Solution migrated to SegCtlr.Netstandard.slnx; global.json pins the .NET 10 SDK. Shared control (covered by the new xUnit project, src/test/SegCtlr.Tests) - SelectedItem selects its segment for string ItemsSource and XAML options; items are compared with Equals. - Replacing Children no longer clears or refills the previous list. - OnSegmentSelected and SegmentSelectedCommand are raised by the control, once per SelectedSegment change, not on page load; RaiseSelectionChanged is obsolete. - ItemsSource: null clears the segments, non-string items fall back to ToString(), observable collections are followed. - Children defaults to an ObservableCollection; edits reach the renderers; segments get Parent and BindingContext. - Weak subscriptions so items and collections do not keep options or controls alive; FontSize default no longer needs Forms.Init(). Renderers (not compiled in this environment) - Detach handlers from the old element and the old segments. - Android: per-button drawable state (Mutate), middle-segment background, disabled control ignores taps, ClearCheck instead of re-inflating, DisabledColor, null checks. - iOS: font and colors for both states, border on IsEnabled/DisabledColor, renderer reuse. - UWP: per-segment WidthRequest, stale-option crash, DisabledColor border. - macOS: rebuild from empty, re-attach child handlers, range checks. Release - Replace build.ps1/publish.ps1/publishLocal.ps1 with GitHub Actions: ci.yml (hosted) and build.yml (GitVersion, releases/** branches, self-hosted Xamarin runners, NuGet.org Trusted Publishing, GitHub Packages, draft GitHub release). See docs/releasing.md. - Pack via src/build/Plugin.SegmentedControl.Package.csproj; a platform without binaries fails the pack. - Include the macOS renderer assembly, which earlier packages left out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
netstandard2.0andnet10.0, with Xamarin.Forms 5.0.0.2662. The solution is nowsrc/main/SegCtlr.Netstandard.slnx.src/test/SegCtlr.Testswith 49 tests covering the shared control. Line coverage is 92.6% and branch coverage 93.2%..editorconfigrules are enforced at build time throughDirectory.Build.props, using C# 14. The library and tests treat warnings as errors, and XML docs are required on public API.build.ps1and the publish scripts are replaced with GitHub Actions, following the WebsocketClientLite.PCL model.Behaviour changes for users
OnSegmentSelectedandSegmentSelectedCommandare raised by the control once perSelectedSegmentchange, and no longer on page load.RaiseSelectionChangedis[Obsolete].SelectedItemnow selects its segment for stringItemsSourceand for options withItemset. Items are compared withEquals.Childrendefaults to anObservableCollection, and runtime edits update the control. Segments get the control asParent.ItemsSourcetonullclears the segments. Non-string items withoutTextPropertyNameshowToString().Bug fixes
Childrenno longer clears or refills the previous list.Forms.Init().DisabledColoris applied.IsEnabledandDisabledColor.WidthRequestis applied per segment.DisabledColorno longer recolours enabled borders.Childrenchanges.Release pipeline
ci.ymlbuilds the library and sample and runs the tests on GitHub-hosted Ubuntu.build.yml("Publish Package") runs whenGitVersion.ymlchanges on areleases/**branch, or by hand. It:v<version>.pull_requesttrigger, so the self-hosted runners never run code from a pull request.docs/releasing.md.Not verified
xamarin;build.yml;1iveowlis the NuGet.org owner account.Test plan
dotnet build src/main/SegCtlr.Netstandard -c Releasebuilds with no warningsdotnet test src/test/SegCtlr.Tests -c Releasepasses all 49 testsdotnet packof the package project works with placeholder renderer binaries, and fails when one platform is missingreleases/5.6.0branch