Bug 36013 - XamlC doesn't work with custom Enums in Xamarin.Forms V2
Summary: XamlC doesn't work with custom Enums in Xamarin.Forms V2
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Stephane Delcroix
: 36082 ()
Depends on:
Reported: 2015-11-18 11:18 UTC by FieldstrikeMobile
Modified: 2015-11-23 05:10 UTC (History)
6 users (show)

Tags: AC xamlc
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 FieldstrikeMobile 2015-11-18 11:18:29 UTC
If I have a CustomControl:

     public class ShapeView : BoxView
         public static readonly BindableProperty ShapeTypeProperty = BindableProperty.Create<ShapeView, ShapeType>(s => s.ShapeType, ShapeType.Box);

         public ShapeType ShapeType
             get { return (ShapeType)GetValue(ShapeTypeProperty); }
             set { SetValue(ShapeTypeProperty, value); }

     public enum ShapeType
I then use it in Xaml like so:

<custom:ShapeView ShapeType="Box"  Color="Red" HorizontalOptions="Fill" VerticalOptions="Fill"/>

Set XamlC on like so:

[assembly: XamlCompilation(XamlCompilationOptions.Compile)]

I get build error:

Enum value not found for Box
Comment 1 Rui Marinho 2015-11-20 07:33:17 UTC
Should be fixed in 2.0.1-pre1
Comment 2 Stephane Delcroix 2015-11-23 05:10:18 UTC
*** Bug 36082 has been marked as a duplicate of this bug. ***