Dear XAMARIN experts,
I would like to ask you how to create the View classes correctly in XAMARIN Forms. I have got used to a specific structure in the Windows Forms.
Problem: Create my own Label class which inherits from Xamarin.Forms.Label and specify its properties.
Attempt:
1.) I created View Class in a project (called ColourLabel)
2.) I changed namespace from MyProject.Views to MyProject
3.) I specified the properties in constructor:
this.BackgroundColor = Color.Gray;
this.MinimumWidthRequest = 100;
this.HorizontalTextAlignment = TextAlignment.Center;
this.FontSize = 16;
I am not sure whether this is a proper way of structuring code in Xamarin. Moreover, I doubt that the XAML file created would have any meaning now (I changed namespace).
Thank you for your help.