小编Nar*_*dra的帖子

如何在Xamarin应用程序中格式化XAML中的日期和时间

我在下面设置了XAML代码.

<Label Text="{Binding Date}"></Label>
<Label Text="{Binding Time}'}"></Label>
Run Code Online (Sandbox Code Playgroud)

我想要结果像9月12,2014 2:30 PM.

datetime xamarin xamarin.forms

28
推荐指数
4
解决办法
4万
查看次数

如何在 Xamarin Forms 中集成 Apple Pay?

我正在使用 xamarin Forms 开发应用程序。现在,我需要集成 Apple pay 我试图通过互联网查找内容,但无法找到可行的解决方案。谁能建议我如何将 Apple pay 集成到我的应用程序中?

这是我的 Apple Pay 代码

using System;
using ApplePayTest.iOS.Dependencies;
using ApplePayTest.Services;
using Foundation;
using PassKit;
using StoreKit;
using Stripe.iOS;
using UIKit;

[assembly: Xamarin.Forms.Dependency(typeof(ApplePayAuthorizer))]
namespace ApplePayTest.iOS.Dependencies
{
    public class ApplePayAuthorizer :PKPaymentAuthorizationViewControllerDelegate,IApplePayAuthorizer
   {
       public bool AuthorizePayment()
       {

           SKProductsRequest req=new SKProductsRequest(new NSSet());
          NSString[] paymentNetworks = new NSString[] {
              PKPaymentNetwork.Visa,
            PKPaymentNetwork.MasterCard
           , PKPaymentNetwork.Amex
               };
            var canmakepayment = PKPaymentAuthorizationViewController.CanMakePayments;

            PKPaymentRequest paymentRequest = new PKPaymentRequest();
             paymentRequest.MerchantIdentifier = "mymerchant code"; 
             paymentRequest.SupportedNetworks = paymentNetworks;
             paymentRequest.MerchantCapabilities = PKMerchantCapability.ThreeDS;
             paymentRequest.CountryCode = …
Run Code Online (Sandbox Code Playgroud)

xcode xamarin.ios xamarin xamarin.forms

9
推荐指数
1
解决办法
1764
查看次数

如何在运行时更改xamarin表单中的MainPage?

在xamarin表单中,RootPage具有主细节布局.我的任务是在用户成功登录后显示该页面.我正在使用azure移动服务登录.我花了更多的时间来获得结果.我看到了其他一些解决方案,但这些解决方案并没有像预期的那样呈现主要细节.最后,我得到了解决方案.

这是app.cs中的代码

public App()
    {

     Client = new MobileServiceClient("your azure url", "your master key");
        LoadMainPage();

    } public void LoadMainPage()
    {
        if (Client.CurrentUser == null)
        {
            MainPage=new NavigationPage(new SplashPage());
        }
        else
        {
            MainPage = new RootView();;
        }


    }
Run Code Online (Sandbox Code Playgroud)

在登录页面

 async void  OnLoginClicked(object sender, EventArgs args)
    {
        MobileServiceUser user;

        try
        {
            user = await DependencyService.Get<IMobileClient>().LoginAsync(MobileServiceAuthenticationProvider.Facebook);
            Application.Current.MainPage=new RootView();
            await Navigation.PopToRootAsync();

        }
        catch (InvalidOperationException ex)
        {
            if (ex.Message.Contains("Authentication was cancelled"))
            {
                //messageLabel.Text = "Authentication cancelled by the user";
            }
        }
        catch (Exception ex)
        { …
Run Code Online (Sandbox Code Playgroud)

azure azure-mobile-services asp.net-web-api2 xamarin-forms

1
推荐指数
1
解决办法
5330
查看次数