Bug 10914 - Make properties virtual
Summary: Make properties virtual
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 4.8.x
Hardware: PC Windows
: Low normal
Target Milestone: ---
Assignee: Atsushi Eno
Depends on:
Reported: 2013-03-05 11:12 UTC by Craig
Modified: 2016-09-14 07:36 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Craig 2013-03-05 11:12:48 UTC
Eligible .NET properties should be marked virtual so that they can be overriden if desired.

Either that or make additional GetProperty / SetProperty methods that can be overriden, as an alternative to using the .NET property.

For example, the below is not possible in Mono for Android, but I believe it is possible in Java:

        override public string Title
            get { return base.Title; }
            set { base.Title = value + " - T"; }
Comment 1 Atsushi Eno 2013-05-22 14:27:37 UTC
We should be careful to change this because changing visibility from virtual to non-virtual could bring binary compatibility breakage.
Comment 2 Atsushi Eno 2016-09-14 07:36:52 UTC
We actually generate virtual properties. Some string properties are not virtual because their actual implementation is XxxFormatted (ICharSequence). Overriding those delegating property wrappers causes inconsistency.