DialogService: Add title-less ShowAsync<T> overloads for options and parameters - #13501
Merged
danielchalmers merged 1 commit intoJul 18, 2026
Conversation
…parameters Adds ShowAsync<T>(DialogOptions) and ShowAsync<T>(DialogParameters, DialogOptions), mirroring the existing title-less ShowAsync<T>(DialogParameters) overload so callers can pass options (or parameters and options) without supplying an empty title. Both forward to the titled implementations using string.Empty, matching the existing convention.
This was referenced Aug 5, 2026
This was referenced Aug 10, 2026
Merged
Merged
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.
Description
Adds two title-less generic
ShowAsync<T>overloads toIDialogService/DialogService:ShowAsync<T>(DialogOptions options)ShowAsync<T>(DialogParameters parameters, DialogOptions options)Today a dialog can be opened with parameters but no title via the existing
ShowAsync<T>(DialogParameters), but there is no equivalent for passingDialogOptions(or parameters + options) without a title, so callers have to pass an explicitnull/empty title. These overloads round out the generic set and forward usingstring.Empty, matching the convention already used byShowAsync<T>()andShowAsync<T>(DialogParameters).Non-breaking (default interface methods)
The two new members are declared as default interface methods on
IDialogService, so existing hand-writtenIDialogServiceimplementations keep compiling with no changes;DialogServicestill provides concrete overrides. This came directly out of dogfooding: adding them as plain abstract members broke a downstream app's hand-rolledIDialogServicetest double (CS0535). The default bodies avoid that while keeping the overloads on the interface, consistent with the rest of theShowAsyncfamily. (Happy to switch these to plain abstract members if you'd prefer to treat it as a normal interface-growth breaking change.)Scope
Limited to the generic
ShowAsync<T>family, not theType-basedShowAsync(Type, ...)family. The generic family already has a title-less overload (ShowAsync<T>(DialogParameters)), soShowAsync<T>(null)is already ambiguous and these additions introduce no new ambiguity. TheType-based family has no title-less overload today, so adding one would newly makeShowAsync(type, null)ambiguous betweenstring? titleand a reference-typed parameter, a source-breaking change. Keeping this to the generic form makes it purely additive.Tests
Added
DialogTests.ShowAsync_TitlelessOverloads_ForwardOptionsAndParameters(both overloads open a dialog with no title and forward options + parameters). Also validated end-to-end by consuming a locally-built package from a downstream .NET MAUI Blazor app (JournalApp): a bUnit test opens a dialog via the nativeShowAsync<T>(DialogOptions)(the app's former extension-method workaround removed), and the app's hand-rolledIDialogServiceimplementation compiles unchanged. Verified on net10.0.