Showing posts with label XAML. Show all posts
Showing posts with label XAML. Show all posts

Thursday, September 12, 2013

Introduction to AlmanacSoft Payer 1.0

Category: Windows Store app, PayPal, REST API, eCommerce

What is AlmanacSoft Payer 1.0?

AlmanacSoft Payer 1.0 is Windows Store app running on Windows 8.1 Preview or later. It is payment app that uses new PayPal's REST APIs with standards-based technologies such as OAuth and JSON for paying money on the Internet. It supports both Direct Credit Card Payment and PayPal Account Payment. The app is native code written in C++/CX and developed by Poom Malakul Na Ayudhya.



How to Install
  1. Download AlmanacSoft Payer 1.0 and you will get the file named "Payer_1.0.0.0_Win32_Test.zip".
  2. Extract it and right click on "Add-AppDevPackage.ps1" to Run with PowerShell. 
  3.  You may be asked to acquire the developer license if you don't have it yet. Use your Microsoft  account to log in and get the license for free. It will be expired in one month and you can renew it.
  4. You may be asked for Execution Policy Change, you have to answer "[Y] Yes"
  5. You may be asked for installing the signing certificate, you have to answer "[Y] Yes". 
  6. AlmanacSoft Payer will be installed successfully.

How to use

For Merchants
  1. You have to register at PayPal for PayPal merchant account.
  2. Log in at https://developer.paypal.com/ with your merchant account. Then create an application to get merchant's Client Id and Secret.
  3. Run AlmanacSoft Payer and select credentials page. Use your Client ID and Secret to apply and export your encrypted merchant data file (MDF).
  4. Send encrypted MDF to your customers by e-mail or let them download from your website.
  5. Tell your customers to use AlmanacSoft Payer to import or download your MDF and use it to make payment for you.
For Customers
  1. Run AlmanacSoft Payer. If you are behind proxy server, set your proxy credentials first.
  2. Using AlmanacSoft Payer to import or download encrypted MDF provided by the merchant you want to pay.
  3. Select appropriate payment method for merchant in the countries supported by PayPal.

Friday, February 15, 2013

Run-time Data Binding

Category: Windows Store App Developing
Prerequisites: XAML, C++, C++/CX, Simple Data Binding

Data binding lets you synchronise UI control elements in XAML with data source that can be dataset, data object or any primitive data types. Usually you just set binding property for any UI control elements and then set BindableAttribute attribute for the ref class in the code behind. And when you compile your code, the compiler will do the rest and all properties in your class will be bindable.

The Problem
Sometimes you may need data class that uses dynamic properties. That means you don’t know at compile time what and how many data properties and types the class should have. This is a common situation such as when you retrieve data set from the SQL server that you usually specify data fields at run time. In these cases, BindableAttribute attribute doesn't help.

The Solution
My solution is to implement ICustomPropertyProvider for the ref class. In this article I call this technique as Run-time Data Binding. The steps are as follows:

1. First, create new ref class with inheriting and implementing ICustomProperty. This class will be used for representing run-time property you will create later.

2. Create another new ref class with inheriting and implementing ICustomPropertyProvider. If you want to be notified when your property changed you can also inherit and implement INotifyPropertyChanged here. Don't forget to inherit from DependencyObject, this is mandatory.


In this class I used Map Collection to store my CustomProperty objects and created two public methods for getting and setting value for CustomProperty target.


Now you will have two ref class that can be used for run-time data binding.

3. Create new ref class to be used for run-time binding which inherit from CustomPropertyProvider ref class. In this case I'll create Person Class that will have name property created at run-time.


4. Insert name property at rum-time.