Hi
I want to crate a User Control (thats the name in WPF and Silverlight). I want to point out that I don't want to write a platform specific control. I want to build a reusable control, including some standard views , own properties and events. Wat I did:
1.) create a Xamarin.Forms/PCL project
2.) add a Class Library (Xamarin.Forms) to the project
3.) change the base class in the Class library code to Stackpanel
4.) Add the ClassLibrary namespace to the MainPage.xaml
5.) Add the control to the content from the main Page
////the ClassLibrary
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xamarin.Forms;
namespace LamXamarinControls
{
public class LamLogonControl : StackLayout
{
public LamLogonControl()
{
var button = new Button
{
Text = "Click Me!",
VerticalOptions = LayoutOptions.CenterAndExpand,
HorizontalOptions = LayoutOptions.CenterAndExpand,
};
int clicked = 0;
button.Clicked += (s, e) => button.Text = "Clicked: " + clicked++;
this.Children.Add(button);
}
}
}
/// the Main Page
<?xml version="1.0" encoding="utf-8" ?>
<lam:LamLogonControl />
</ContentPage>
If I step to the code I get the Exception:
Xamarin.Forms.Xaml.XamlParsException: Position ...... Type: .... not found in clr-namespace .....
Wat I'm doing wrong ?