Skip to content
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

fix!: Remove ToggleButton.OnIsCheckedChanged #12266

Merged
merged 3 commits into from
May 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/PackageDiffIgnore.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@
<Member fullName="System.Void Windows.UI.Xaml.Media.Animation.RepeatBehavior.set_Type(Windows.UI.Xaml.Media.Animation.RepeatBehaviorType value)" reason="Api alignments" />
<Member fullName="System.Void Windows.Media.Playback.MediaPlayer.set_Position(System.TimeSpan value)" reason="Api alignments" />
<Member fullName="System.TimeSpan Windows.Media.Playback.MediaPlayer.get_Position()" reason="Api alignments" />

<Member fullName="System.Void Windows.UI.Xaml.Controls.Primitives.ToggleButton.OnIsCheckedChanged(System.Nullable`1&lt;System.Boolean&gt; oldValue, System.Nullable`1&lt;System.Boolean&gt; newValue)" reason="Api alignments" />
<Member fullName="System.Void Windows.UI.Xaml.Media.Animation.Timeline.Dispose(System.Boolean disposing)" reason="Api alignments" />
<Member fullName="System.Void Windows.UI.Xaml.Media.Animation.Timeline.Dispose()" reason="Api alignments" />

Expand Down
25 changes: 0 additions & 25 deletions src/Uno.UI/UI/Xaml/Controls/Primitives/ToggleButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,31 +87,6 @@ public bool IsThreeState
/// </summary>
internal bool CanRevertState { get; set; } = true;

protected virtual void OnIsCheckedChanged(bool? oldValue, bool? newValue)
{
// This workaround can be removed if pooling is removed. See https://github.com/unoplatform/uno/issues/12189
Youssef1313 marked this conversation as resolved.
Show resolved Hide resolved
if (_suppressCheckedChanged)
{
return;
}

if (IsChecked == null)
{
// Indeterminate
Indeterminate?.Invoke(this, new RoutedEventArgs(this));
}
else if (IsChecked.Value)
{
// Checked
Checked?.Invoke(this, new RoutedEventArgs(this));
}
else
{
// Unchecked
Unchecked?.Invoke(this, new RoutedEventArgs(this));
}
}

public void OnTemplateRecycled()
{
try
Expand Down