Bug 29561 - generated code doesn't compile for base classes with generics
Summary: generated code doesn't compile for base classes with generics
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.1
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-04-29 18:39 UTC by George Cook
Modified: 2015-04-29 19:08 UTC (History)
3 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 George Cook 2015-04-29 18:39:36 UTC
I have a custom generic content page base class:

		public class BasePage<TViewModel> : ContentPage where TViewModel : BaseViewModel

in my subclass I have the code behind :

			public partial class EventsPage : TwinEvents.Core.App.View.BasePage<EventsPageVM>

In the xaml I have:

	Title="{Binding Title}"

the issue I have is that the generated file won't compile, as it doesn't correctly refernece the BasePage class. It generates this:

		public partial class EventsPage : BasePage<TwinEvents.Core.Events.View.EventsPageVM>

instead of this:

		public partial class EventsPage : TwinEvents.Core.App.View.BasePage<TwinEvents.Core.Events.View.EventsPageVM>

I can temporarily fix it by adding the missing path qualifier; but then have to edit it *every time I change the file!*.

My question is.. is this a bug? is this expected behaviour? am I doing something wrong?

I mentioned this iin another thread; but realized that was a different problem, hence putting this here instead.
Comment 1 George Cook 2015-04-29 19:08:40 UTC
I'm working around it right now with a bash script that executes whenever I
build, and fixes the import statement; but it kind of sucks, especially seeing
as the only way I can get Xamarin to run it, is in an external window, so I
need to close a terminal window on each build... hmmph
[reply] [-] Comment 2 George Cook 2015-04-29 19:07:18 EDT
resolved it - by using  a custom namespace. 

    xmlns:page="clr-namespace:TwinEvents.Core.App.View ; assembly=TwinEvents" 
    Title="{Binding Title}"

please ignore this issue - perhaps it might help others if they find the ticket
though :)