我使用Raspberry Pi作为我的主电脑。我使用MonoDevelop编写C#程序和单声道来运行它们。我为我的GUI使用System.Windows.Forms。当我完成后,我有一个可以在Raspberry Pi或Windows上运行的.exe。我有一个类可以帮助我在运行时向窗体添加控件。
public static class ControlCreator
{
public static void Add(this Control.ControlCollection collection
,out GroupBox box,string id, string text, int left, int top
, int width, int height)
{
box = new GroupBox();
box.Text = text;
AddControl (collection,box,id,left,top,width,height);
return;
}
public static void Add(this Control.ControlCollection collection
,out Button box,string id, string text, int left, int top
, int width, int height)
{
box = new Button();
box.Text = text;
AddControl (collection,box,id,left,top,width,height);
return;
}
public static void Add(this Control.ControlCollection collection
,out Label box,string id, string text, int left, int top
, int width, int height)
{
box = new Label();
box.Text = text;
AddControl (collection,box,id,left,top,width,height);
return;
}
private static void AddControl(
Control.ControlCollection collection,Control box,string id, int left
, int top, int width, int height)
{
box.Name = id;
box.Left = left;
box.Top = top;
box.Width = width;
box.Height = height;
collection.Add(box);
return;
}
}
XF是Android和iOS的UI层。它不在RPi上运行。您可以使用在PI上运行的任何语言编写Web服务,并与运行在Android/iOS上的XF应用程序进行通信。 – Jason
我明白你在说Xamarin Forms是UI层,从我读的内容,Xamarin,IOS和Xamarin.Android构建在Mono之上。这与Xamarin Forms相同吗? – Andy
XF在X.iOS和X.Android之上运行 – Jason