Introducing Dialog builder API, some minor reworks#456
Closed
appleneko2001 wants to merge 5 commits intoAvaloniaCommunity:masterfrom
Closed
Introducing Dialog builder API, some minor reworks#456appleneko2001 wants to merge 5 commits intoAvaloniaCommunity:masterfrom
appleneko2001 wants to merge 5 commits intoAvaloniaCommunity:masterfrom
Conversation
… Material Dialog package
Contributor
Author
|
btw this API can be used for replacing current DialogHelper implementation and keep DialogHelper API until next major update or considering to keep it |
Collaborator
|
Can you extract HeaderedContentControl to separate PR, to merge them separately sooner? |
Contributor
Author
|
Contributor
Author
|
yea im gonna rebase but github refuses |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closed
Due to some issues I have closed this PR. new conversations should be appear in PR #458
Details
This PR will add Dialog builder API, which allows you to create dialog control / window easily and flexible to put elements freely, and no more limited for standalone window use. You can use dialog layout whatever you want.
Also, I noticed that there have missing control theme forits in PR #457HeaderedContentControl, and I have added my control theme implementation for it.Exposed API
Warning
Those API is pretty sketchy, some of them would be questionable for further use. Please leave comments for trending about them!
DialogBuilderSetTitle(string text)SetTitleIcon(DialogIconKind icon)SetTitleIcon(Bitmap bitmap, Stretch stretch = Stretch.Uniform)Text(string text)Control(Control control)PositiveButton(object content, object returnValue, Func<bool>? shouldClose = null)NeutralButton(object content, object returnValue, Action? onClick = null)NegativeButton(object content, object returnValue, Func<bool>? shouldClose = null)Style(IStyle style)Build()BuildWithStateAccessor()BuildWindow()BuildAndShowDialogAsync(Window owner, CancellationToken cancellationToken = default, Action<Window>? modifier = null)BuildAndShowAsync(Window? owner = null, CancellationToken cancellationToken = default, Action<Window>? modifier = null)Changes
CompositeDataTemplatethat works more easily to pick a suitableDataTemplatefrom a set.Add: ControlTheme forPR Add missing HeaderedContentControl control theme #457HeaderedContentControlScreenshots