コード例 #1
0
        private async Task ListPointsAsync()
        {

            // Request an instance of the default Wallet store.
            wallet = await WalletManager.RequestStoreAsync();

            // Find an existing wallet item.
            walletItem = await wallet.GetWalletItemAsync("CoffeeLoyalty123");

            if (walletItem == null)
            {
                rootPage.NotifyUser("Item does not exist. Add item using Scenario2", NotifyType.ErrorMessage);
                return;
            }

            if (walletItem.DisplayProperties.ContainsKey("PointsId"))
            {
                CoffePointsValue.Text = walletItem.DisplayProperties["PointsId"].Value;
            }
            else
            {
                rootPage.NotifyUser("Item does not have a PointsId property.", NotifyType.ErrorMessage);
                return;
            }

        }
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage = MainPage.Current;

            // Request an instance of the default Wallet store.
            wallet = await WalletManager.RequestStoreAsync();

            // Get the wallet item to be used in this scenario.
            walletItem = await wallet.GetWalletItemAsync("CoffeeLoyalty123");
        }
コード例 #3
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            rootPage = MainPage.Current;

            // Request an instance of the default Wallet store.
            wallet = await WalletManager.RequestStoreAsync();

            // Get the wallet item to be used in this scenario.
            walletItem = await wallet.GetWalletItemAsync("CoffeeLoyalty123");
        }
コード例 #4
0
        public async Task ShowWalletItemAsync()
        {
            WalletItem walletItem = await wallet.GetWalletItemAsync("CoffeeLoyalty123");

            // If the item exists, show it in Wallet
            if (walletItem != null)
            {
                // Launch Wallet and navigate to item
                await wallet.ShowAsync(walletItem.Id);
            }
            else
            {
                // Item does not exist, so just launch Wallet.
                // Alternatively, you could tell the user that the item they want to see does not exist
                // and stay in your app.
                await wallet.ShowAsync();
            }
        }
コード例 #5
0
        /// <summary>
        /// show wallet
        /// </summary>
        /// <returns></returns>
        public async Task ShowWalletItemAsync()
        {
            try
            {
                WalletItem walletItem = await wallet.GetWalletItemAsync(conCardID);

                if (walletItem != null)
                {
                    await this.wallet.ShowAsync(walletItem.Id);
                }
                else
                {
                    await this.wallet.ShowAsync();
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
コード例 #6
0
        private async Task ListPointsAsync()
        {
            // Request an instance of the default Wallet store.
            wallet = await WalletManager.RequestStoreAsync();

            // Find an existing wallet item.
            walletItem = await wallet.GetWalletItemAsync("CoffeeLoyalty123");

            if (walletItem == null)
            {
                rootPage.NotifyUser("Item does not exist. Add item using Scenario2", NotifyType.ErrorMessage);
                return;
            }

            if (walletItem.DisplayProperties.ContainsKey("PointsId"))
            {
                CoffePointsValue.Text = walletItem.DisplayProperties["PointsId"].Value;
            }
            else
            {
                rootPage.NotifyUser("Item does not have a PointsId property.", NotifyType.ErrorMessage);
                return;
            }
        }