[英]How do i Use a PCL project to develop an app for Android and iOS in Xamarin?
I have created a Xamarin PCL project, it has Android iOS and Portable. 我创建了一个Xamarin PCL项目,它有Android iOS和Portable。 I had a look at few examples, where in you can create a Login Page using
Xaml
and then validate those credentials using a CS file for it,but my question is lets say I validate those credentials, how do I jump from that UI page which is universal I suppose to the Android or the iOS part? 我看了几个例子,你可以在哪里使用
Xaml
创建一个登录页面,然后使用CS文件验证这些凭据,但我的问题是我可以说我验证了这些凭据,我如何从那个UI页面跳转是普遍的我想Android或iOS部分?
And where do I start ?? 我从哪里开始?
Sorry if I am being naive, I am new to Xamarin, any help would be appreciated. 对不起,如果我天真,我是Xamarin的新手,任何帮助将不胜感激。
This is the sample i'm referring for Portable, 这是我所说的便携式样品,
using System;
using Xamarin.Forms;
namespace StoreCredentials
{
public class HomePageCS : ContentPage
{
public HomePageCS ()
{
var toolbarItem = new ToolbarItem {
Text = "Logout"
};
toolbarItem.Clicked += OnLogoutButtonClicked;
ToolbarItems.Add (toolbarItem);
Title = "Home Page";
Content = new StackLayout {
Children = {
new Label {
Text = "Main app content goes here",
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.CenterAndExpand
}
}
};
}
async void OnLogoutButtonClicked (object sender, EventArgs e)
{
DependencyService.Get<ICredentialsService> ().DeleteCredentials ();
Navigation.InsertPageBefore (new LoginPage (), this);
await Navigation.PopAsync ();
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.