-
Notifications
You must be signed in to change notification settings - Fork 1.9k
added Command and CommandParameter on CheckBox #20717
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
Conversation
|
Hey there @pictos! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
f53de5d to
29f9a43
Compare
rmarinho
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also add a simple UITest to show how it renderers check and uncheck and a Visual test.
Thanks
|
@rmarinho does maui use inline docs normally or there's some xml file that I should add? |
# Conflicts: # src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
29f9a43 to
984fecc
Compare
@rmarinho can you point me to a UITest that I can use as sample... I tried to look into the existing one on Appium project, but couldn't figure out how to create the UI to test |
We use inline docs now. @jfversluis can help you with that if you need.
Add your UI here : Add your test here: Run it one time on CI to generate the screenshots and add them here: |
Yes please add the documentation inline and NOT the external XML files :) |
mattleibow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The is looking close, but I had some questions/comments.
- Should the command and the event always fire (or not) together?
- Please add inline XML docs
- Please add some unit tests for the checkbox in the areas:
- CheckChanged event
- Command/CommandParameter
- IsEnabled
- Please add some UI tests for checkbox:
- Appears correctly in the correct state with Command CanExecute
- Tapping the check box when enabled and disabled does the right thing
| checkBox.CheckedChanged?.Invoke(bindable, new CheckedChangedEventArgs((bool)newValue)); | ||
| if (checkBox.Command is not null && checkBox.Command.CanExecute(checkBox.CommandParameter)) | ||
| { | ||
| checkBox.Command.Execute(checkBox.CommandParameter); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what we should be doing here as we are going to fire the CheckChanged event but NOT the command if the command disabled it.
The command can disable the checkbox, and that is fine. But, if the dev then manually sets checked and we only fire one, will that be unexpected? Do we have a place where we have an event and command and we have to do something like this?
I found Button does this:
public static void ElementClicked(VisualElement visualElement, IButtonElement ButtonElementManager)
{
if (visualElement.IsEnabled == true)
{
ButtonElementManager.Command?.Execute(ButtonElementManager.CommandParameter);
ButtonElementManager.PropagateUpClicked(); // <- this is the clicked event
}
}|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/rebase |
|
Needs manual rebase |
|
Please reopen targeting the net10 branch |
Description of Change
Issues Fixed
Fixes #7394