public static PurchasePopUp newInstance(Constants.PURCHASE_TYPE type, Action callBack = null) { PurchasePopUp pPopUp = new PurchasePopUp(); pPopUp.mType = type; pPopUp.PurchaseCallBack = callBack; return(pPopUp); }
public static PurchasePopUp Create(Constants.PURCHASE_TYPE type) { var arr = NSBundle.MainBundle.LoadNib("PurchasePopUp", null, null); var v = Runtime.GetNSObject <PurchasePopUp>(arr.ValueAt(0)); v.mType = type; var width = UIScreen.MainScreen.Bounds.Width * 0.95f; var height = width * 7 / 9; var posX = (UIScreen.MainScreen.Bounds.Width - width) / 2; var posY = (UIScreen.MainScreen.Bounds.Height - height) / 2; v.Frame = new CGRect(posX, posY, width, height); v.effectView.Alpha = 0; v.lblTitle.Text = Constants.PURCHASE_TITLE[(int)type]; v.lblDescription1.Text = Constants.PURCHASE_DESCRIPTION1[(int)type]; v.lblDescription2.Text = Constants.PURCHASE_DESCRIPTION2[(int)type]; v.lblBtnTitle.Text = Constants.PURCHASE_BUTTON[(int)type]; return(v); }