question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Spec] Remove members marked with Obsolete attribute

See original GitHub issue

Description

Remove members marked with the Obsolete attribute.

Core

Class Member to Remove Removed? PR
Application LogWarningsToApplicationOutput https://github.com/xamarin/Xamarin.Forms/pull/13813
BindableObject GetValues https://github.com/xamarin/Xamarin.Forms/pull/13813
BindableObjectExtensions SetBinding https://github.com/xamarin/Xamarin.Forms/pull/13813
BindableProperty Create https://github.com/xamarin/Xamarin.Forms/pull/13813
BindableProperty CreateAttached https://github.com/xamarin/Xamarin.Forms/pull/13813
BindableProperty CreateAttachedReadOnly https://github.com/xamarin/Xamarin.Forms/pull/13813
BindableProperty CreateReadOnly https://github.com/xamarin/Xamarin.Forms/pull/13813
Binding Create https://github.com/xamarin/Xamarin.Forms/pull/13813
Button BorderRadius https://github.com/xamarin/Xamarin.Forms/pull/13813
Button Image https://github.com/xamarin/Xamarin.Forms/pull/13813
Button BorderRadiusProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
Button ImageProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
EntryCell XAlign https://github.com/xamarin/Xamarin.Forms/pull/13813
Label XAlign https://github.com/xamarin/Xamarin.Forms/pull/13813
EntryCell XAlignProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
Label XAlignProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
Color Fuschia https://github.com/xamarin/Xamarin.Forms/pull/13813
Device OnPlatform https://github.com/xamarin/Xamarin.Forms/pull/13813
Device OnPlatform https://github.com/xamarin/Xamarin.Forms/pull/13813
Device OpenUri https://github.com/xamarin/Xamarin.Forms/pull/13813
Device OS https://github.com/xamarin/Xamarin.Forms/pull/13813
Element ParentView https://github.com/dotnet/maui/pull/1644
Element Platform https://github.com/xamarin/Xamarin.Forms/pull/13813
IElementController Platform https://github.com/xamarin/Xamarin.Forms/pull/13813
Element PlatformSet https://github.com/xamarin/Xamarin.Forms/pull/13813
IElementController PlatformSet https://github.com/xamarin/Xamarin.Forms/pull/13813
Font BoldSystemFontOfSize https://github.com/xamarin/Xamarin.Forms/pull/13813
Font BoldSystemFontOfSize https://github.com/xamarin/Xamarin.Forms/pull/13813
Frame OutlineColor https://github.com/xamarin/Xamarin.Forms/pull/13813
Frame OutlineColorProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
IExtendedTypeConverter ConvertFrom https://github.com/xamarin/Xamarin.Forms/pull/13813
IMenuItemController IsEnabledPropertyName https://github.com/xamarin/Xamarin.Forms/pull/13813
MenuItem IsEnabledPropertyName https://github.com/xamarin/Xamarin.Forms/pull/13813
ItemTappedEventArgs .ctor https://github.com/xamarin/Xamarin.Forms/pull/13813
ItemVisibilityEventArgs .ctor https://github.com/xamarin/Xamarin.Forms/pull/13813
Label Font https://github.com/xamarin/Xamarin.Forms/pull/13813
Label YAlign https://github.com/xamarin/Xamarin.Forms/pull/13813
Label YAlignProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
Layout GetSizeRequest https://github.com/dotnet/maui/pull/1644
VisualElement GetSizeRequest https://github.com/dotnet/maui/pull/1644
MenuItem Icon https://github.com/xamarin/Xamarin.Forms/pull/13813
Page Icon https://github.com/xamarin/Xamarin.Forms/pull/13813
MenuItem IconProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
Page IconProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
NavigationPage GetTitleIcon https://github.com/xamarin/Xamarin.Forms/pull/13813
NavigationPage SetTitleIcon https://github.com/xamarin/Xamarin.Forms/pull/13813
NavigationPage Tint https://github.com/xamarin/Xamarin.Forms/pull/13813
NavigationPage TintProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
NavigationPage TitleIconProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
OnPlatform<T> Android https://github.com/xamarin/Xamarin.Forms/pull/13813
OnPlatform<T> iOS https://github.com/xamarin/Xamarin.Forms/pull/13813
OnPlatform<T> WinPhone https://github.com/xamarin/Xamarin.Forms/pull/13813
Page DisplayPromptAsync https://github.com/xamarin/Xamarin.Forms/pull/13813
Page BackgroundImage https://github.com/xamarin/Xamarin.Forms/pull/13813
Page BackgroundImageProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
ResourceDictionary MergedWith https://github.com/xamarin/Xamarin.Forms/pull/13813
SelectedItemChangedEventArgs .ctor https://github.com/xamarin/Xamarin.Forms/pull/13813
IShellSectionController SendPopped https://github.com/xamarin/Xamarin.Forms/pull/13813
IShellSectionController SendPopping https://github.com/xamarin/Xamarin.Forms/pull/13813
IShellSectionController SendPopped https://github.com/xamarin/Xamarin.Forms/pull/13813
Slider ThumbImage https://github.com/xamarin/Xamarin.Forms/pull/13813
Slider ThumbImageProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
Span Font https://github.com/xamarin/Xamarin.Forms/pull/13813
Span ForegroundColorProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
TapGestureRecognizer .ctor https://github.com/xamarin/Xamarin.Forms/pull/13813
TapGestureRecognizer .ctor https://github.com/xamarin/Xamarin.Forms/pull/13813
TapGestureRecognizer TappedCallback https://github.com/xamarin/Xamarin.Forms/pull/13813
TapGestureRecognizer TappedCallbackParameter https://github.com/xamarin/Xamarin.Forms/pull/13813
TapGestureRecognizer TappedCallbackProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
TapGestureRecognizer TappedCallbackParameterProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
ToolbarItem Name https://github.com/xamarin/Xamarin.Forms/pull/13813
ToolbarItem Activated https://github.com/xamarin/Xamarin.Forms/pull/13813
TypeConverter ConvertFrom https://github.com/xamarin/Xamarin.Forms/pull/13813
TypeConverter ConvertFrom https://github.com/xamarin/Xamarin.Forms/pull/13813
StyleSheets.StyleSheet FromAssemblyResource https://github.com/xamarin/Xamarin.Forms/pull/13813
PlatformConfiguration.AndroidSpecific.TabbedPage GetBarItemColor https://github.com/xamarin/Xamarin.Forms/pull/13813
PlatformConfiguration.AndroidSpecific.TabbedPage SetBarItemColor https://github.com/xamarin/Xamarin.Forms/pull/13813
PlatformConfiguration.AndroidSpecific.TabbedPage GetBarItemColor https://github.com/xamarin/Xamarin.Forms/pull/13813
PlatformConfiguration.AndroidSpecific.TabbedPage SetBarItemColor https://github.com/xamarin/Xamarin.Forms/pull/13813
PlatformConfiguration.AndroidSpecific.TabbedPage BarItemColorProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
PlatformConfiguration.AndroidSpecific.TabbedPage GetBarSelectedItemColor https://github.com/xamarin/Xamarin.Forms/pull/13813
PlatformConfiguration.AndroidSpecific.TabbedPage SetBarSelectedItemColor https://github.com/xamarin/Xamarin.Forms/pull/13813
PlatformConfiguration.AndroidSpecific.TabbedPage SetBarSelectedItemColor https://github.com/xamarin/Xamarin.Forms/pull/13813
PlatformConfiguration.AndroidSpecific.TabbedPage GetBarSelectedItemColor https://github.com/xamarin/Xamarin.Forms/pull/13813
PlatformConfiguration.AndroidSpecific.TabbedPage BarSelectedItemColorProperty https://github.com/xamarin/Xamarin.Forms/pull/13813
Internals.IPlatform GetNativeSize Don’t know, but IPlatform is gone, so…
Internals.NavigationRequestedEventArgs .ctor https://github.com/xamarin/Xamarin.Forms/pull/13813
Internals.NavigationRequestedEventArgs Realize https://github.com/xamarin/Xamarin.Forms/pull/13813
Internals.ResourceLoader CanProvideContentFor https://github.com/dotnet/maui/pull/1637
Internals.ResourceLoader ResourceProvider https://github.com/dotnet/maui/pull/1637
Internals.PromptArguments .ctor https://github.com/xamarin/Xamarin.Forms/pull/13813
Internals.TypedBinding<TSource, TProperty> .ctor https://github.com/xamarin/Xamarin.Forms/pull/13813

Maps

Class Member to Remove Removed? PR
Maps.Pin SendTap https://github.com/xamarin/Xamarin.Forms/pull/13813
Maps.Pin Id https://github.com/xamarin/Xamarin.Forms/pull/13813
Maps.Pin Clicked https://github.com/xamarin/Xamarin.Forms/pull/13813

Xaml

Class Member to Remove Removed? PR
Xaml.Internals.SimpleValueTargetProvider .ctor(object[]) https://github.com/xamarin/Xamarin.Forms/pull/13813
Xaml.Internals.SimpleValueTargetProvider .ctor(object[], object[]) https://github.com/xamarin/Xamarin.Forms/pull/13813

UWP

Class Member to Remove Removed? PR
Platform.UAP.BoxViewRenderer
Platform.UAP.FormsSlider ThumbImage
Platform.UAP.RendererFactory

iOS

Class Member to Remove Removed? PR
Platform.iOS.RendererFactory
Platform.iOS.WebViewRenderer

Android

Class Member to Remove Removed? PR
Platform.Android.AndroidActivity
Platform.Android.PageExtensions CreateFragment

Android Renderer Constructors

Each renderer which existed as of 2.4 has an obsolete constructor which does not take a Context parameter.

Backward Compatibility

Any applications or libraries still using the obsolete properties or methods will have to update.

Difficulty : Low

Mostly this just means deleting methods and properties which already call through to other methods and properties. In a few cases we may also need to remove non-public members which are no longer used.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
PureWeencommented, Oct 14, 2020

I’d say change them to use the non-generic version

All the generic version one does is call through to the non-generic one

		[Obsolete("Create<> (generic) is obsolete as of version 2.1.0 and is no longer supported.")]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public static BindableProperty Create<TDeclarer, TPropertyType>(Expression<Func<TDeclarer, TPropertyType>> getter, TPropertyType defaultValue, BindingMode defaultBindingMode = BindingMode.OneWay,
																		ValidateValueDelegate<TPropertyType> validateValue = null, BindingPropertyChangedDelegate<TPropertyType> propertyChanged = null,
																		BindingPropertyChangingDelegate<TPropertyType> propertyChanging = null, CoerceValueDelegate<TPropertyType> coerceValue = null,
																		CreateDefaultValueDelegate<TDeclarer, TPropertyType> defaultValueCreator = null) where TDeclarer : BindableObject
		{
			return Create(getter, defaultValue, defaultBindingMode, validateValue, propertyChanged, propertyChanging, coerceValue, null, defaultValueCreator: defaultValueCreator);
		}

So if we need to add it back (for some reason) we can just add a Unit test specifically there to validate the generic one

0reactions
PureWeencommented, Oct 14, 2020

Hmmmmm @domagojmedo I would leave that one for now

We’ll replace that one with the layout updates… I’m not sure off hand with that one because our OnMeasure code calls into that obsolete method 😃

So the fix might just be to make GetSizeRequest internal ? But I’m not really sure off hand

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Usage of the Obsolete attribute
Step 1. Mark the member or class as [Obsolete]. Step 2. Update all internal uses of the member or class to either use...
Read more >
Allow Obsolete attribute on getters and setters · Issue #32472
The attribute Obsolete is used to mark types and members of types that should no longer be used. using System; [AttributeUsage(AttributeTargets.
Read more >
Miscellaneous attributes interpreted by the C# compiler
The Obsolete attribute marks a code element as no longer recommended for use. Use of an entity marked obsolete generates a warning or...
Read more >
ObsoleteAttribute Class (System)
Marking an element as obsolete informs users that the element may be removed in a future version of the product. The string assigned...
Read more >
Experimental, deprecated, and obsolete - MDN Web Docs
Remove the item from any lists of properties, attributes, methods, and so forth. For methods of an interface, for example, this means removing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found