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

Remove virtual generic methods from ValueStore. #7980

Merged
merged 7 commits into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from 6 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
5 changes: 2 additions & 3 deletions samples/SampleControls/HamburgerMenu/HamburgerMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,13 @@ protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
_splitView = e.NameScope.Find<SplitView>("PART_NavigationPane");
}

protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> change)
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
{
base.OnPropertyChanged(change);

if (change.Property == BoundsProperty && _splitView is not null)
{
var oldBounds = change.OldValue.GetValueOrDefault<Rect>();
var newBounds = change.NewValue.GetValueOrDefault<Rect>();
var (oldBounds, newBounds) = change.GetOldAndNewValue<Rect>();
EnsureSplitViewMode(oldBounds, newBounds);
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/Avalonia.Base/Animation/Animatable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,13 @@ protected void DisableTransitions()
}
}

protected sealed override void OnPropertyChangedCore<T>(AvaloniaPropertyChangedEventArgs<T> change)
protected sealed override void OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs change)
{
if (change.Property == TransitionsProperty && change.IsEffectiveValueChange)
{
var oldTransitions = change.OldValue.GetValueOrDefault<Transitions>();
var newTransitions = change.NewValue.GetValueOrDefault<Transitions>();
var e = (AvaloniaPropertyChangedEventArgs<Transitions?>)change;
var oldTransitions = e.OldValue.GetValueOrDefault();
var newTransitions = e.NewValue.GetValueOrDefault();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can use that new GetOldAndNewValue helper right?


// When transitions are replaced, we add the new transitions before removing the old
// transitions, so that when the old transition being disposed causes the value to
Expand Down
58 changes: 57 additions & 1 deletion src/Avalonia.Base/ApiCompatBaseline.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
Compat issues with assembly Avalonia.Base:
MembersMustExist : Member 'public void Avalonia.AvaloniaObject.CoerceValue<T>(Avalonia.StyledPropertyBase<T>)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'protected Avalonia.IAvaloniaObject Avalonia.AvaloniaObject.InheritanceParent.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'protected void Avalonia.AvaloniaObject.InheritanceParent.set(Avalonia.IAvaloniaObject)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'protected void Avalonia.AvaloniaObject.OnPropertyChanged<T>(Avalonia.AvaloniaPropertyChangedEventArgs<T>)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'protected void Avalonia.AvaloniaObject.OnPropertyChangedCore<T>(Avalonia.AvaloniaPropertyChangedEventArgs<T>)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public void Avalonia.AvaloniaObject.SetValue(Avalonia.AvaloniaProperty, System.Object, Avalonia.Data.BindingPriority)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.IDisposable Avalonia.AvaloniaObjectExtensions.Bind(Avalonia.IAvaloniaObject, Avalonia.AvaloniaProperty, System.IObservable<Avalonia.Data.BindingValue<System.Object>>, Avalonia.Data.BindingPriority)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.IDisposable Avalonia.AvaloniaObjectExtensions.Bind(Avalonia.IAvaloniaObject, Avalonia.AvaloniaProperty, System.IObservable<System.Object>, Avalonia.Data.BindingPriority)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public void Avalonia.AvaloniaObjectExtensions.ClearValue(Avalonia.IAvaloniaObject, Avalonia.AvaloniaProperty)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public void Avalonia.AvaloniaObjectExtensions.ClearValue<T>(Avalonia.IAvaloniaObject, Avalonia.AvaloniaProperty<T>)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.Object Avalonia.AvaloniaObjectExtensions.GetValue(Avalonia.IAvaloniaObject, Avalonia.AvaloniaProperty)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.IDisposable Avalonia.AvaloniaObjectExtensions.SetValue(Avalonia.IAvaloniaObject, Avalonia.AvaloniaProperty, System.Object, Avalonia.Data.BindingPriority)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'public System.IDisposable Avalonia.AvaloniaObjectExtensions.SetValue<T>(Avalonia.IAvaloniaObject, Avalonia.AvaloniaProperty<T>, T, Avalonia.Data.BindingPriority)' does not exist in the implementation but it does exist in the contract.
CannotAddAbstractMembers : Member 'internal System.IDisposable Avalonia.AvaloniaProperty.RouteBind(Avalonia.AvaloniaObject, System.IObservable<Avalonia.Data.BindingValue<System.Object>>, Avalonia.Data.BindingPriority)' is abstract in the implementation but is missing in the contract.
MembersMustExist : Member 'internal System.IDisposable Avalonia.AvaloniaProperty.RouteBind(Avalonia.IAvaloniaObject, System.IObservable<Avalonia.Data.BindingValue<System.Object>>, Avalonia.Data.BindingPriority)' does not exist in the implementation but it does exist in the contract.
CannotAddAbstractMembers : Member 'internal void Avalonia.AvaloniaProperty.RouteClearValue(Avalonia.AvaloniaObject)' is abstract in the implementation but is missing in the contract.
MembersMustExist : Member 'internal void Avalonia.AvaloniaProperty.RouteClearValue(Avalonia.IAvaloniaObject)' does not exist in the implementation but it does exist in the contract.
CannotAddAbstractMembers : Member 'internal System.Object Avalonia.AvaloniaProperty.RouteGetBaseValue(Avalonia.AvaloniaObject, Avalonia.Data.BindingPriority)' is abstract in the implementation but is missing in the contract.
MembersMustExist : Member 'internal System.Object Avalonia.AvaloniaProperty.RouteGetBaseValue(Avalonia.IAvaloniaObject, Avalonia.Data.BindingPriority)' does not exist in the implementation but it does exist in the contract.
CannotAddAbstractMembers : Member 'internal System.Object Avalonia.AvaloniaProperty.RouteGetValue(Avalonia.AvaloniaObject)' is abstract in the implementation but is missing in the contract.
MembersMustExist : Member 'internal System.Object Avalonia.AvaloniaProperty.RouteGetValue(Avalonia.IAvaloniaObject)' does not exist in the implementation but it does exist in the contract.
CannotAddAbstractMembers : Member 'internal void Avalonia.AvaloniaProperty.RouteInheritanceParentChanged(Avalonia.AvaloniaObject, Avalonia.AvaloniaObject)' is abstract in the implementation but is missing in the contract.
MembersMustExist : Member 'internal void Avalonia.AvaloniaProperty.RouteInheritanceParentChanged(Avalonia.AvaloniaObject, Avalonia.IAvaloniaObject)' does not exist in the implementation but it does exist in the contract.
CannotAddAbstractMembers : Member 'internal System.IDisposable Avalonia.AvaloniaProperty.RouteSetValue(Avalonia.AvaloniaObject, System.Object, Avalonia.Data.BindingPriority)' is abstract in the implementation but is missing in the contract.
MembersMustExist : Member 'internal System.IDisposable Avalonia.AvaloniaProperty.RouteSetValue(Avalonia.IAvaloniaObject, System.Object, Avalonia.Data.BindingPriority)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.IAvaloniaObject.AddInheritanceChild(Avalonia.IAvaloniaObject)' is present in the contract but not in the implementation.
MembersMustExist : Member 'public void Avalonia.IAvaloniaObject.AddInheritanceChild(Avalonia.IAvaloniaObject)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public System.IDisposable Avalonia.IAvaloniaObject.Bind(Avalonia.AvaloniaProperty, System.IObservable<System.Object>, Avalonia.Data.BindingPriority)' is present in the implementation but not in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public System.IDisposable Avalonia.IAvaloniaObject.Bind<T>(Avalonia.DirectPropertyBase<T>, System.IObservable<Avalonia.Data.BindingValue<T>>)' is present in the contract but not in the implementation.
MembersMustExist : Member 'public System.IDisposable Avalonia.IAvaloniaObject.Bind<T>(Avalonia.DirectPropertyBase<T>, System.IObservable<Avalonia.Data.BindingValue<T>>)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public System.IDisposable Avalonia.IAvaloniaObject.Bind<T>(Avalonia.StyledPropertyBase<T>, System.IObservable<Avalonia.Data.BindingValue<T>>, Avalonia.Data.BindingPriority)' is present in the contract but not in the implementation.
MembersMustExist : Member 'public System.IDisposable Avalonia.IAvaloniaObject.Bind<T>(Avalonia.StyledPropertyBase<T>, System.IObservable<Avalonia.Data.BindingValue<T>>, Avalonia.Data.BindingPriority)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.IAvaloniaObject.ClearValue(Avalonia.AvaloniaProperty)' is present in the implementation but not in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.IAvaloniaObject.ClearValue<T>(Avalonia.DirectPropertyBase<T>)' is present in the contract but not in the implementation.
MembersMustExist : Member 'public void Avalonia.IAvaloniaObject.ClearValue<T>(Avalonia.DirectPropertyBase<T>)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.IAvaloniaObject.ClearValue<T>(Avalonia.StyledPropertyBase<T>)' is present in the contract but not in the implementation.
MembersMustExist : Member 'public void Avalonia.IAvaloniaObject.ClearValue<T>(Avalonia.StyledPropertyBase<T>)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.IAvaloniaObject.CoerceValue(Avalonia.AvaloniaProperty)' is present in the implementation but not in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.IAvaloniaObject.CoerceValue<T>(Avalonia.StyledPropertyBase<T>)' is present in the contract but not in the implementation.
MembersMustExist : Member 'public void Avalonia.IAvaloniaObject.CoerceValue<T>(Avalonia.StyledPropertyBase<T>)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public Avalonia.Data.Optional<T> Avalonia.IAvaloniaObject.GetBaseValue<T>(Avalonia.StyledPropertyBase<T>, Avalonia.Data.BindingPriority)' is present in the contract but not in the implementation.
MembersMustExist : Member 'public Avalonia.Data.Optional<T> Avalonia.IAvaloniaObject.GetBaseValue<T>(Avalonia.StyledPropertyBase<T>, Avalonia.Data.BindingPriority)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public System.Object Avalonia.IAvaloniaObject.GetValue(Avalonia.AvaloniaProperty)' is present in the implementation but not in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public T Avalonia.IAvaloniaObject.GetValue<T>(Avalonia.DirectPropertyBase<T>)' is present in the contract but not in the implementation.
MembersMustExist : Member 'public T Avalonia.IAvaloniaObject.GetValue<T>(Avalonia.DirectPropertyBase<T>)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public T Avalonia.IAvaloniaObject.GetValue<T>(Avalonia.StyledPropertyBase<T>)' is present in the contract but not in the implementation.
MembersMustExist : Member 'public T Avalonia.IAvaloniaObject.GetValue<T>(Avalonia.StyledPropertyBase<T>)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.IAvaloniaObject.InheritedPropertyChanged<T>(Avalonia.AvaloniaProperty<T>, Avalonia.Data.Optional<T>, Avalonia.Data.Optional<T>)' is present in the contract but not in the implementation.
MembersMustExist : Member 'public void Avalonia.IAvaloniaObject.InheritedPropertyChanged<T>(Avalonia.AvaloniaProperty<T>, Avalonia.Data.Optional<T>, Avalonia.Data.Optional<T>)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.IAvaloniaObject.RemoveInheritanceChild(Avalonia.IAvaloniaObject)' is present in the contract but not in the implementation.
MembersMustExist : Member 'public void Avalonia.IAvaloniaObject.RemoveInheritanceChild(Avalonia.IAvaloniaObject)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public System.IDisposable Avalonia.IAvaloniaObject.SetValue(Avalonia.AvaloniaProperty, System.Object, Avalonia.Data.BindingPriority)' is present in the implementation but not in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.IAvaloniaObject.SetValue<T>(Avalonia.DirectPropertyBase<T>, T)' is present in the contract but not in the implementation.
MembersMustExist : Member 'public void Avalonia.IAvaloniaObject.SetValue<T>(Avalonia.DirectPropertyBase<T>, T)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public System.IDisposable Avalonia.IAvaloniaObject.SetValue<T>(Avalonia.StyledPropertyBase<T>, T, Avalonia.Data.BindingPriority)' is present in the contract but not in the implementation.
MembersMustExist : Member 'public System.IDisposable Avalonia.IAvaloniaObject.SetValue<T>(Avalonia.StyledPropertyBase<T>, T, Avalonia.Data.BindingPriority)' does not exist in the implementation but it does exist in the contract.
InterfacesShouldHaveSameMembers : Interface member 'public void Avalonia.Threading.IDispatcher.Post<T>(System.Action<T>, T, Avalonia.Threading.DispatcherPriority)' is present in the implementation but not in the contract.
Total Issues: 1
Total Issues: 57
Loading