Mark ToggleButton.onChecked/onUnchecked/onIndeterminate as Obsolete#484
Draft
Numpsy wants to merge 2 commits intofsprojects:masterfrom
Draft
Mark ToggleButton.onChecked/onUnchecked/onIndeterminate as Obsolete#484Numpsy wants to merge 2 commits intofsprojects:masterfrom
Numpsy wants to merge 2 commits intofsprojects:masterfrom
Conversation
They're marked as obsolete in Avalonia 11 and have been removed in 12. We can mark them as obsolete over here as well, and remove some local uses of them prior to the v12 update so that we have fewer changes to make later.
Collaborator
Author
|
These were removed from Avalonia 12 in https://github.com/AvaloniaUI/Avalonia/pull/20617/changes#diff-cebc11bab0b74bcb60742a90e4d7ef7839b1174fc0375ed669f386a8c276b8a6 |
Collaborator
Author
|
Theres a couple of Radio buttons in the Presso samples that could do with changing as well, but I'm out of time for now |
Numpsy
commented
Feb 8, 2026
| RadioButton.horizontalAlignment HorizontalAlignment.Stretch | ||
| RadioButton.onChecked (fun _ -> | ||
| state.Set { state.Current with water = i } | ||
| RadioButton.onIsCheckedChanged(fun args -> |
Collaborator
Author
There was a problem hiding this comment.
This doesn't seem the most friendly approach to things.
I wonder if there would be value in doing something like
type RadioButton with
static member onChecked<'t when 't :> RadioButton>(func: RoutedEventArgs -> unit, ?subPatchOptions) : IAttr<'t> =
let onCheckedHandler (args: RoutedEventArgs) =
match args.Source with
| :? RadioButton as selection when selection.IsChecked.GetValueOrDefault() = true ->
func(args)
| _ -> ()
AttrBuilder<'t>.CreateSubscription<RoutedEventArgs>(RadioButton.IsCheckedChangedEvent, onCheckedHandler, ?subPatchOptions = subPatchOptions)to remove some duplication?
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.
They're marked as obsolete in Avalonia 11 and have been removed in 12.
We can mark them as obsolete over here as well, and remove some local uses of them prior to the v12 update so that we have fewer changes to make later.