From c7b42d13262000e88e71b9598fd73ca1d6f98d44 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 7 Sep 2018 15:56:29 +0200 Subject: [PATCH] Add the old overloads back in. And mark them as `[Obsolete]`. --- src/Avalonia.Layout/Layoutable.cs | 30 +++++++++++++++++++++++++++ src/Avalonia.Styling/StyledElement.cs | 27 ++++++++++++++++++++++++ src/Avalonia.Visuals/Visual.cs | 17 +++++++++++++++ 3 files changed, 74 insertions(+) diff --git a/src/Avalonia.Layout/Layoutable.cs b/src/Avalonia.Layout/Layoutable.cs index b8b24e6d31..1eee2de042 100644 --- a/src/Avalonia.Layout/Layoutable.cs +++ b/src/Avalonia.Layout/Layoutable.cs @@ -427,6 +427,21 @@ namespace Avalonia.Layout /// After a call to this method in a control's static constructor, any change to the /// property will cause to be called on the element. /// + [Obsolete("Use AffectsMeasure and specify the control type.")] + protected static void AffectsMeasure(params AvaloniaProperty[] properties) + { + AffectsMeasure(properties); + } + + /// + /// Marks a property as affecting the control's measurement. + /// + /// The control which the property affects. + /// The properties. + /// + /// After a call to this method in a control's static constructor, any change to the + /// property will cause to be called on the element. + /// protected static void AffectsMeasure(params AvaloniaProperty[] properties) where T : class, ILayoutable { @@ -444,6 +459,21 @@ namespace Avalonia.Layout /// After a call to this method in a control's static constructor, any change to the /// property will cause to be called on the element. /// + [Obsolete("Use AffectsArrange and specify the control type.")] + protected static void AffectsArrange(params AvaloniaProperty[] properties) + { + AffectsArrange(properties); + } + + /// + /// Marks a property as affecting the control's arrangement. + /// + /// The control which the property affects. + /// The properties. + /// + /// After a call to this method in a control's static constructor, any change to the + /// property will cause to be called on the element. + /// protected static void AffectsArrange(params AvaloniaProperty[] properties) where T : class, ILayoutable { diff --git a/src/Avalonia.Styling/StyledElement.cs b/src/Avalonia.Styling/StyledElement.cs index 5745abd673..3d0c840040 100644 --- a/src/Avalonia.Styling/StyledElement.cs +++ b/src/Avalonia.Styling/StyledElement.cs @@ -488,6 +488,17 @@ namespace Avalonia InheritanceParent = parent; } + /// + /// Adds a pseudo-class to be set when a property is true. + /// + /// The property. + /// The pseudo-class. + [Obsolete("Use PseudoClass and specify the control type.")] + protected static void PseudoClass(AvaloniaProperty property, string className) + { + PseudoClass(property, className); + } + /// /// Adds a pseudo-class to be set when a property is true. /// @@ -500,6 +511,22 @@ namespace Avalonia PseudoClass(property, x => x, className); } + /// + /// Adds a pseudo-class to be set when a property equals a certain value. + /// + /// The type of the property. + /// The property. + /// Returns a boolean value based on the property value. + /// The pseudo-class. + [Obsolete("Use PseudoClass and specify the control type.")] + protected static void PseudoClass( + AvaloniaProperty property, + Func selector, + string className) + { + PseudoClass(property, selector, className); + } + /// /// Adds a pseudo-class to be set when a property equals a certain value. /// diff --git a/src/Avalonia.Visuals/Visual.cs b/src/Avalonia.Visuals/Visual.cs index c2db20306e..6915ec596b 100644 --- a/src/Avalonia.Visuals/Visual.cs +++ b/src/Avalonia.Visuals/Visual.cs @@ -320,6 +320,23 @@ namespace Avalonia /// on the control which when changed should cause a redraw. This is similar to WPF's /// FrameworkPropertyMetadata.AffectsRender flag. /// + [Obsolete("Use AffectsRender and specify the control type.")] + protected static void AffectsRender(params AvaloniaProperty[] properties) + { + AffectsRender(properties); + } + + /// + /// Indicates that a property change should cause to be + /// called. + /// + /// The control which the property affects. + /// The properties. + /// + /// This method should be called in a control's static constructor with each property + /// on the control which when changed should cause a redraw. This is similar to WPF's + /// FrameworkPropertyMetadata.AffectsRender flag. + /// protected static void AffectsRender(params AvaloniaProperty[] properties) where T : class, IVisual {