/// <summary> /// Attachs to purchase manager. /// </summary> /// <param name="purchaseManager">Purchase manager.</param> public void AttachToPurchaseManager(UIStoryboard Storyboard, InAppPurchaseManager purchaseManager) { // Save connection to purchase manager _Storyboard = Storyboard; PurchaseManager = purchaseManager; // Scan sub view controllers foreach (UIViewController controller in ChildViewControllers) { //Console.WriteLine (controller.ToString ()); // Wireup sub views to the master purchase controller if (controller is PurchaseTableViewController) { // Found the previous purchase table, save and initialize _purchaseTable = (PurchaseTableViewController)controller; _purchaseTable.AttachToPurchaseManager (_Storyboard, purchaseManager); } else if (controller is StoreTableViewController) { // Found the available products for sale table, save and initialize _storeTable = (StoreTableViewController)controller; _storeTable.AttachToPurchaseManager (_Storyboard, purchaseManager); } else if (controller is FeaturesController) { // Found special features, save and initialize _featuresController = (FeaturesController)controller; _featuresController.AttachToPurchaseManager (_Storyboard, purchaseManager); } else if (controller is SettingsController) { // Found settings, save and initialize _settingsController = (SettingsController)controller; _settingsController.AttachToPurchaseManager (_Storyboard, purchaseManager); } } }
public MMXDVCSLMListViewSource (ObservableCollection<MainMenuListItem> MenuItems, string MenuType, UIViewController MenuViewController, UIStoryboard StoryboardController) { this.MenuItems = MenuItems; this.MenuType = MenuType; this.MenuViewController = MenuViewController; this.StoryboardController = StoryboardController; }
public DataViewController GetViewController (nint index, UIStoryboard storyboard) { var dataViewController = (DataViewController)storyboard.InstantiateViewController ("DataViewController"); dataViewController.PageNumber = index + 1; dataViewController.Pdf = pdf; return dataViewController; }
public override void ViewDidLoad () { base.ViewDidLoad (); // Perform any additional setup after loading the view, typically from a nib. TCViewIdentity.getInstance.setObjectForKey ("TCSplashScreenViewController", this); addObserverNetwork (); startObserverNetwork (); myStoryboard = UIStoryboard.FromName ("MainStoryboard_iPhone", null); if (Reachability.InternetConnectionStatus () != NetworkStatus.NotReachable) { MApplication.getInstance ().isNetworkDisconnected = false; if (CoreSystem.Utils.getRememberLogin ()) { this.acIndicator.StartAnimating (); authentication (); } else { startNormal (); } } else { MApplication.getInstance ().isNetworkDisconnected = true; startNormal (); } }
/// <summary> /// Navigate to a view based on a storyboard identifier and/or a view controller type. /// Assumes that no more than one instance of the specified controller type should exist in the navigation stack. /// </summary> /// <param name="viewControllerIdentifier">The storyboard identifier for a storyboard view controller; otherwise null.</param> /// <param name="viewControllerType">The view controller type. Specify for automatically navigating back to an existing instance if that exists on the navigation stack. Also specify to create non-storyboard view controller if none exists in the navigation stack.</param> /// <param name="animated">A boolean indicating whether the navigation transition should be animated</param> private void Navigate(string viewControllerIdentifier, Type viewControllerType = null, bool animated = false, UIStoryboard storyBoard = null) { if (viewControllerType != null) { if (NavigationContext.TopViewController != null && viewControllerType == NavigationContext.TopViewController.GetType()) return; if (NavigationContext.ViewControllers != null) { foreach (var stackViewController in NavigationContext.ViewControllers) { if (stackViewController.GetType() == viewControllerType) { NavigationContext.PopToViewController(stackViewController, animated); return; } } } } if (storyBoard == null) storyBoard = NavigationContext.Storyboard; var viewController = (viewControllerIdentifier != null && storyBoard != null) ? (UIViewController)storyBoard.InstantiateViewController(viewControllerIdentifier) : (UIViewController)Activator.CreateInstance(viewControllerType); NavigationContext.PushViewController(viewController, animated); }
public AMSDataTableSource(List<TodoItem> toDodata, UITableViewController controller, string cellId, UIStoryboard storyboard) { this.data = toDodata; this.controller = controller; this.CellId = cellId; this.OptStoryboard = storyboard; }
public static QuestionnaireCountriesViewController Create() { UIStoryboard storyboard = UIStoryboard.FromName("QuestionnaireCountries", null); QuestionnaireCountriesViewController vc = storyboard.InstantiateInitialViewController() as QuestionnaireCountriesViewController; vc.ModalPresentationStyle = UIModalPresentationStyle.FullScreen; return(vc); }
public void OpenSettingsVC() { var storyboard = UIStoryboard.FromName("MainStoryboard", null); var SettingsVC = storyboard.InstantiateViewController("SettingsViewController") as SettingsViewController; NavController.PushViewController(SettingsVC, true); SidebarController.CloseMenu(true); }
public static LoadingPageViewController Create() { UIStoryboard storyboard = UIStoryboard.FromName("LoadingPage", null); LoadingPageViewController vc = storyboard.InstantiateInitialViewController() as LoadingPageViewController; vc.ModalPresentationStyle = UIModalPresentationStyle.FullScreen; return(vc); }
protected void MoveFoward(string sbName, string viewId) { UIStoryboard sb = UIStoryboard.FromName(sbName, null); var view = sb.InstantiateViewController(viewId); NavigationController.SetViewControllers(new UIViewController[] { view }, false); }
public static DailyNumbersViewController Create() { UIStoryboard storyboard = UIStoryboard.FromName("DailyNumbers", null); DailyNumbersViewController vc = (DailyNumbersViewController)storyboard.InstantiateInitialViewController(); vc.ModalPresentationStyle = UIModalPresentationStyle.FullScreen; return(vc); }
public ViewChanger(UIViewController view, string changeTo) { UIStoryboard board = UIStoryboard.FromName("Main", null); UIViewController ctrl = (UIViewController)board.InstantiateViewController(changeTo); ctrl.ModalTransitionStyle = UIModalTransitionStyle.FlipHorizontal; view.PresentViewController(ctrl, true, null); }
protected override IMvxIosView CreateViewOfType(Type viewType, MvxViewModelRequest request) { MvxTrace.Trace(MvxTraceLevel.Diagnostic, viewType.Name); string storyboardName = TRStoryboardHelper.GetStoryboardName(viewType); return((IMvxIosView)UIStoryboard.FromName(storyboardName, null).InstantiateViewController(viewType.Name)); }
public static InformationAndConsentViewController GetInformationAndConsentViewController() { UIStoryboard storyboard = UIStoryboard.FromName("InformationAndConsent", null); InformationAndConsentViewController vc = storyboard.InstantiateInitialViewController() as InformationAndConsentViewController; vc.ModalPresentationStyle = UIModalPresentationStyle.FullScreen; return(vc); }
public Task(string storyboardName) { // activities don't HAVE to have a storyboard if (false == string.IsNullOrEmpty(storyboardName)) { Storyboard = UIStoryboard.FromName(storyboardName, null); } }
public static MessagePageViewController Create() { UIStoryboard storyboard = UIStoryboard.FromName("MessagePage", null); MessagePageViewController vc = (MessagePageViewController)storyboard.InstantiateInitialViewController(); vc.ModalPresentationStyle = UIModalPresentationStyle.FullScreen; return(vc); }
UIViewController LoadChallengeDetail(string storyboardID) { UIStoryboard board = UIStoryboard.FromName("Challenges", null); ChallengeDetailBaseViewController controller = (ChallengeDetailBaseViewController)board.InstantiateViewController(storyboardID); controller.Challenge = Challenge; return(controller); }
private void TransitionViewController(object state) { UIApplication.SharedApplication.InvokeOnMainThread(delegate { SignInViewController signinController = (SignInViewController)UIStoryboard.FromName("Main", null).InstantiateViewController("SignInViewController"); this.NavigationController.PushViewController(signinController, true); }); }
private void RemoveView(UIView view) { UIStoryboard storyboard = (UIStoryboard)target; storyboard.Views.Remove(view); DestroyImmediate(view.gameObject); EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); }
partial void registrar(UIButton sender) { UIStoryboard menuSB = UIStoryboard.FromName("Menu", null); var menuRootViewController = menuSB.InstantiateViewController("MenuRootViewController"); View.Window.RootViewController = menuRootViewController; return; }
/* * partial void UIBarButtonItem138_Activated(UIBarButtonItem sender) * { * //Menu list * * var alert = UIAlertController.Create("Budget Menu", "Choose one action you need", UIAlertControllerStyle.ActionSheet); * * if (alert.PopoverPresentationController != null) * alert.PopoverPresentationController.BarButtonItem = sender as UIBarButtonItem; * * alert.AddAction (UIAlertAction.Create ("Ok", UIAlertActionStyle.Cancel, null)); * * * alert.AddAction(UIAlertAction.Create("Add Cost", UIAlertActionStyle.Default, (obj) => tryyyy())); * * alert.AddAction (UIAlertAction.Create ("Cost Simulator", UIAlertActionStyle.Default,null)); * * alert.AddAction (UIAlertAction.Create ("Setup Warning", UIAlertActionStyle.Default, null)); * * alert.AddAction (UIAlertAction.Create ("Edit", UIAlertActionStyle.Default, null)); * * PresentViewController(alert, animated: true, completionHandler: null); * }*/ private void tryyyy() { UIStoryboard board = UIStoryboard.FromName("Main", null); UIViewController ctrl = (UIViewController)board.InstantiateViewController("AddCostController"); NavigationController.PushViewController(ctrl, true); }
private void MyProfileButton_TouchUpInside(object sender, EventArgs e) { var LokasyonKisilerStory = UIStoryboard.FromName("PrivateProfileBaseVC", NSBundle.MainBundle); PrivateProfileBaseVC controller = LokasyonKisilerStory.InstantiateViewController("PrivateProfileBaseVC") as PrivateProfileBaseVC; controller.ModalPresentationStyle = UIModalPresentationStyle.FullScreen; this.PresentViewController(controller, true, null); }
partial void UIBarButtonItem247_Activated(UIBarButtonItem sender) { var storyboard = UIStoryboard.FromName("Main", null); var addNewViewController = storyboard.InstantiateViewController("AddNewViewController") as AddNewViewController; addNewViewController.TableViewController = this; this.NavigationController.PushViewController(addNewViewController, true); }
private void SetupUserInterface() { var board = UIStoryboard.FromName("Main", null); var viewController = board.InstantiateInitialViewController(); ViewController.AddChildViewController(viewController); ViewController.View.Add(viewController.View); }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { window = new UIWindow(UIScreen.MainScreen.Bounds); storyboard = UIStoryboard.FromName("PNChartStoryboard", null); window.RootViewController = (UIViewController)storyboard.InstantiateInitialViewController(); window.MakeKeyAndVisible(); return(true); }
void BookFlightButton_TouchUpInside(object sender, EventArgs e) { var storyboard = UIStoryboard.FromName("Main", null); FlightListViewController flightListViewController = storyboard.InstantiateViewController("FlightListViewController") as FlightListViewController; NavigationController.PushViewController(flightListViewController, true); }
public static LoginViewController NewInstance(LoginViewModel viewModel) { var storyboard = UIStoryboard.FromName("Login", null); var instance = storyboard.InstantiateViewController(nameof(LoginViewController)) as LoginViewController; instance.ViewModel = viewModel; return(instance); }
/// <summary> /// Cambiars the view controller raiz. /// </summary> /// <param name="idViewController">Identifier view controller.</param> /// <param name="nombreStoryBoard">Nombre story board.</param> public void cambiarViewControllerRaiz(String idViewController, String nombreStoryBoard) { var appDelegate = UIApplication.SharedApplication.Delegate as AppDelegate; var vc = UIStoryboard.FromName(nombreStoryBoard, null).InstantiateViewController(idViewController); appDelegate.Window.RootViewController = vc; appDelegate.Window.MakeKeyAndVisible(); }
private void SimulatorFunc() { UIStoryboard board = UIStoryboard.FromName("Main", null); UIViewController ctrl = (UIViewController)board.InstantiateViewController("BudgetSimulatorController"); NavigationController.PushViewController(ctrl, true); }
private void Chart() { UIStoryboard board = UIStoryboard.FromName("Main", null); UIViewController ctrl = (UIViewController)board.InstantiateViewController("Report"); NavigationController.PushViewController(ctrl, true); }
private void AddCreditCard(object sender, EventArgs args) { UIStoryboard sb = UIStoryboard.FromName("MainStoryboard", null); AddCreditCardViewController pvc = (AddCreditCardViewController)sb.InstantiateViewController("AddCreditCardViewController"); pvc.fromWhere = "bill"; _NavigationController.PushViewController(pvc, true); }
public override void RowSelected(UITableView tableView, Foundation.NSIndexPath indexPath) { var sb = UIStoryboard.FromName("Main", null); var ctrl = sb.InstantiateViewController("SignInViewController") as SignInViewController; ctrl.ApplyTheme = indexPath.Row == 1; NavigationController.PushViewController(ctrl, true); }
private void GoToAddParticipants() { var storyBoard = UIStoryboard.FromName(StoryboardNames.ADD_PARTICIPANT, null); var viewController = storyBoard.InstantiateViewController("AddParticipants") as AddParticipantsViewController; viewController.SetViewModel(this.ViewModel); this.NavigationController.PushViewController(viewController, true); }
public static WorkflowResultsViewController InstantiateWith(SBSDKUIWorkflowStepResult[] workflowResults) { UIStoryboard storyboard = UIStoryboard.FromName("Main", null); WorkflowResultsViewController controller = (WorkflowResultsViewController)storyboard.InstantiateViewController("WorkflowResultsViewController"); controller.WorkflowResults = workflowResults; return(controller); }
private void InitializeViewSlider() { if (viewItems != null && viewItems.Count > 0) { var storyboard = UIStoryboard.FromName("Sliders", null); baseViewControllers = new List <BaseViewController>(); int max = viewItems.Count; SetIndicatorPage(max); for (int i = 0; i < max; i++) { var item = viewItems[i]; var bounds = supportSlideBase.Bounds; var size = new CoreGraphics.CGRect(bounds.X, bounds.Y, bounds.Width, bounds.Height); Console.WriteLine(size.ToString()); if (Platform.GetRenderer(item) == null) { Platform.SetRenderer(item, Platform.CreateRenderer(item)); } var vRenderer = Platform.GetRenderer(item); vRenderer.NativeView.Frame = size; vRenderer.NativeView.AutoresizingMask = UIViewAutoresizing.All; vRenderer.NativeView.ContentMode = UIViewContentMode.ScaleToFill; vRenderer.Element?.Layout(size.ToRectangle()); var nativeView = vRenderer.NativeView; nativeView.SetNeedsLayout(); //var renderer = Platform.CreateRenderer(item); //Console.WriteLine(supportSlideBase.Bounds); //var size = new CoreGraphics.CGRect(0,0, supportSlideBase.Bounds.Width, supportSlideBase.Bounds.Height); //renderer.NativeView.Frame = size; //renderer.NativeView.AutoresizingMask = UIViewAutoresizing.All; //renderer.NativeView.ContentMode = UIViewContentMode.ScaleToFill; //renderer.Element.Layout(size.ToRectangle()); //var nativeView = renderer.NativeView; //nativeView.SetNeedsLayout(); var blankViewController = (BlankViewController)storyboard.InstantiateViewController("BlankViewController"); blankViewController.Index = i; blankViewController.View = nativeView; baseViewControllers.Add(blankViewController); } slideDataSource = new BaseSlideDataSource(baseViewControllers); pageViewController.DataSource = slideDataSource; pageViewController.SetViewControllers(new UIViewController[] { baseViewControllers[0] }, UIPageViewControllerNavigationDirection.Forward, false, null); } else { ClearInstance(); } }
public override void OnActivated(UIApplication application) { if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { if (UIScreen.MainScreen.Bounds.Size.Height == 480) //iPhone 4 { Window = new UIWindow(UIScreen.MainScreen.Bounds); UIStoryboard board = UIStoryboard.FromName("Main4", null); UIViewController rootView = (UIViewController)board.InstantiateViewController("NavigationController"); if (NSUserDefaults.StandardUserDefaults.BoolForKey("saveMVC")) { rootView = (UIViewController)board.InstantiateViewController("MasterViewController"); } Window.RootViewController = rootView; Window.MakeKeyAndVisible(); } else if (UIScreen.MainScreen.Bounds.Size.Height == 568) //iPhone 5 { Window = new UIWindow(UIScreen.MainScreen.Bounds); UIStoryboard board = UIStoryboard.FromName("Main5", null); UIViewController rootView = (UIViewController)board.InstantiateViewController("NavigationController"); Window.RootViewController = rootView; Window.MakeKeyAndVisible(); } else if (UIScreen.MainScreen.Bounds.Size.Height == 667) //iPhone 6 { Window = new UIWindow(UIScreen.MainScreen.Bounds); UIStoryboard board = UIStoryboard.FromName("Main6", null); UIViewController rootView = (UIViewController)board.InstantiateViewController("NavigationController"); if (NSUserDefaults.StandardUserDefaults.BoolForKey("saveMVC")) { rootView = (UIViewController)board.InstantiateViewController("MasterViewController"); } Window.RootViewController = rootView; Window.MakeKeyAndVisible(); } else if (UIScreen.MainScreen.Bounds.Size.Height == 736) //iPhone 6+ { Window = new UIWindow(UIScreen.MainScreen.Bounds); UIStoryboard board = UIStoryboard.FromName("Main6P", null); UIViewController rootView = (UIViewController)board.InstantiateViewController("NavigationController"); if (NSUserDefaults.StandardUserDefaults.BoolForKey("saveMVC")) { rootView = (UIViewController)board.InstantiateViewController("MasterViewController"); } Window.RootViewController = rootView; Window.MakeKeyAndVisible(); } } }
// Sign Out public void signOut(UIStoryboard storyBoard) { MApplication.getInstance ().isLogedIn = false; TCGlobals.getInstance.isAllowShowAlert = false; TCNotificationCenter.defaultCenter.observers.Clear (); MApplication.getInstance ().isConnectedSignalR = false; UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false; new System.Threading.Thread (new System.Threading.ThreadStart (() => { if (TCGlobals.getInstance.currentSignalR != null) TCGlobals.getInstance.currentSignalR.stop (); })).Start (); TCLogOutHelper logoutHelper = new TCLogOutHelper (UIApplication.SharedApplication.KeyWindow.RootViewController); logoutHelper.logOut (); TCViewIdentity.getInstance.setObjectForKey ("TCMainTabViewController", null); TCViewIdentity.getInstance.setObjectForKey ("TCBookingAlertViewController", null); TCViewIdentity.getInstance.setObjectForKey ("TCBookingConfirmedViewController", null); TCViewIdentity.getInstance.setObjectForKey ("TCBookingPastViewController", null); TCViewIdentity.getInstance.setObjectForKey ("TCBookingRequestViewController", null); TCSortTable.currentIndexPath = NSIndexPath.FromRowSection (0, 0); CoreSystem.Utils.keepAccessToken (""); CoreSystem.Utils.keepEmail (""); TCGlobals.getInstance.accessToken = ""; MApplication.getInstance ().isRequired = true; MApplication.getInstance ().userId = Guid.Empty; TCGlobals.getInstance.isAddObserverSplash = false; TCGlobals.getInstance.searchFromDashboard = false; TCGlobals.getInstance.myEmail = ""; TCHomeViewController homeVC = (TCHomeViewController)storyBoard.InstantiateViewController ("TCHomeViewController"); UINavigationController rootVC = new UINavigationController (); rootVC.SetViewControllers (new UIViewController[] { homeVC }, true); UIApplication.SharedApplication.Delegate.GetWindow ().RootViewController = rootVC; UIApplication.SharedApplication.Delegate.GetWindow ().MakeKeyAndVisible (); if (TCViewIdentity.getInstance.getObjectForKey ("TCMainTabViewController") != null) { TCMainTabViewController mainVC = (TCMainTabViewController)TCViewIdentity.getInstance.getObjectForKey ("TCMainTabViewController"); mainVC.Dispose(); } if (TCViewIdentity.getInstance.getObjectForKey ("TCSplashScreenViewController") != null && !TCGlobals.getInstance.isAddObserverSplash) { TCSplashScreenViewController splashScreenVC = (TCSplashScreenViewController)TCViewIdentity.getInstance.getObjectForKey ("TCSplashScreenViewController"); splashScreenVC.addObserverNetwork (); } }
public void FacebookLoggedIn (bool didLogIn, string accessToken, string userId, Exception error) { if (didLogIn) { AppCommon.Inst.InitUser (userId); StoryBoard = UIStoryboard.FromName (AppCommon.Inst.IsPassenger.Value ? "Passenger" : "Driver", null); _navController.PushViewController(StoryBoard.InstantiateInitialViewController () as UIViewController, true); } else { new UIAlertView ("Failed to Log In", "Reason: " + error.Message, null, "Ok", null).Show(); } }
public DataViewController GetViewController (int index, UIStoryboard storyboard) { if (index >= pageData.Count) return null; // Create a new view controller and pass suitable data. var dataViewController = (DataViewController)storyboard.InstantiateViewController ("DataViewController"); dataViewController.DataObject = pageData [index]; return dataViewController; }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching (UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); _storyboard = UIStoryboard.FromName ("Main", null); _nav = new UINavigationController( (ScannerHome)_storyboard.InstantiateInitialViewController () ); window.RootViewController = _nav; // make the window visible window.MakeKeyAndVisible (); return true; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { _window = new UIWindow(UIScreen.MainScreen.Bounds); MainStoryBoardName = "MainStoryboard_iPhone"; if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) { MainStoryBoardName = "MainStoryboard_iPad"; } Storyboard = UIStoryboard.FromName(MainStoryBoardName, null); initialViewController = Storyboard.InstantiateInitialViewController(); _window.RootViewController = initialViewController; _window.MakeKeyAndVisible(); return true; }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { // create a new window instance based on the screen size UIApplication.SharedApplication.SetMinimumBackgroundFetchInterval (UIApplication.BackgroundFetchIntervalMinimum); UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; window = new UIWindow (UIScreen.MainScreen.Bounds); if (UserInterfaceIdiomIsPhone) { Storyboard = UIStoryboard.FromName ("MainStoryboard_iPhone", null); } else { Storyboard = UIStoryboard.FromName ("MainStoryboard_iPad", null); } var initialViewController = Storyboard.InstantiateInitialViewController () as UIViewController; window.RootViewController = initialViewController; window.MakeKeyAndVisible (); return true; }
public override async void ViewDidLoad() { _storyboard = this.Storyboard; MoreMenuBtn.Clicked += MoreMenuBtn_Clicked; this.RefreshControl.ValueChanged += RefreshControl_ValueChanged;; // var notificationView = new GCDiscreetNotificationView ( // text: "sync todo list", // activity: true, // presentationMode: GCDNPresentationMode.Top, // view: View // ); // //notificationView.TintColor = UIColor.Blue; // notificationView.Show (animated: true); // await LoadToDoList(false); // notificationView.Hide(true); base.ViewDidLoad(); }
/// <summary> /// This the main entry point for the app on iOS /// </summary> public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { //Create our window Window = new UIWindow(UIScreen.MainScreen.Bounds); //Register some services ServiceContainer.Register (Window); ServiceContainer.Register <ISynchronizeInvoke>(() => new SynchronizeInvoke()); //Apply our UI theme Theme.Apply (); //Load our storyboard and setup our UIWindow and first view controller storyboard = UIStoryboard.FromName ("MainStoryboard", null); loginController = storyboard.InstantiateInitialViewController () as LoginController; Window.RootViewController = loginController; Window.MakeKeyAndVisible (); return true; }
/// <summary> /// Attachs to purchase manager. /// </summary> /// <param name="purchaseManager">Purchase manager.</param> public void AttachToPurchaseManager(UIStoryboard Storyboard, InAppPurchaseManager purchaseManager) { // Save connection _Storyboard = Storyboard; _purchaseManager = purchaseManager; // Respond to events _purchaseManager.ReceivedValidProducts += (products) => { // Received valid products from the iTunes App Store, // Update the display ReloadData(); }; _purchaseManager.InAppProductPurchased += (transaction, product) => { // Update list to remove any non-consumable products that were // purchased ReloadData(); }; _purchaseManager.InAppPurchaseProductQuantityConsumed += (identifier) => { // Update list to remove any consumable products that were // used up ReloadData(); }; _purchaseManager.InAppPurchasesRestored += (count) => { // Update list to remove any non-consumable products that were // purchased and restored if (count>0) ReloadData(); }; _purchaseManager.TransactionObserver.InAppPurchaseContentDownloadFailed += (download) => { // If a download fails we have still purchased a product show we need to show it // on the list and show that it is still awaiting download. ReloadData(); }; // Display initial data ReloadData (); }
/// <summary> /// Attachs to purchase manager. /// </summary> /// <param name="purchaseManager">Purchase manager.</param> public void AttachToPurchaseManager(UIStoryboard Storyboard, InAppPurchaseManager purchaseManager) { // Save connection _Storyboard = Storyboard; _purchaseManager = purchaseManager; // Respond to events _purchaseManager.InAppProductPurchased += (StoreKit.SKPaymentTransaction transaction, InAppProduct product) => { // Update the display UpdateCoinCount(); }; _purchaseManager.InAppPurchaseProductQuantityConsumed += (identifier) => { // Update the display UpdateCoinCount(); }; // Display initial data UpdateCoinCount (); }
/// <summary> /// Attachs to purchase manager. /// </summary> /// <param name="purchaseManager">Purchase manager.</param> public void AttachToPurchaseManager(UIStoryboard Storyboard, InAppPurchaseManager purchaseManager) { // Save connection _Storyboard = Storyboard; _purchaseManager = purchaseManager; }
//Create an instance of the viewController name from the storyboard public UIViewController GetViewController(UIStoryboard storyboard , string viewControllerName) { return storyboard.InstantiateViewController (viewControllerName); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////// /// /// Events of the class /// //////////////////////////////////////////////////////////////////////////////////////////////////////////// #region Class Events /// <summary> /// Purpose : Main launching event -> Read ServerIP, MainColor -> Apply the Main Theme -> Set the window -> Connectivity observer -> Run the login viewcontroller /// </summary> /// <returns><c>true</c>, if launching was finisheded, <c>false</c> otherwise.</returns> /// <param name="application">Application.</param> /// <param name="launchOptions">Launch options.</param> public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions) { // First initialize and then set the ServerIP DataAccessLayer.SQLiteUtilities.Initialize(); DataAccessLayer.Utilities.ServerIP = BusinessLayer.User.GetUrl(); DataAccessLayer.Utilities.MainColor = BusinessLayer.User.GetColor(); if (BusinessLayer.User.GetGunTheme() == 0) Application.GunTheme = false; else { Application.GunTheme = true; GunmetalTheme.Apply(); } // Apply the theme // Override point for customization after application launch. Window = new UIWindow(UIScreen.MainScreen.Bounds); Application._uiWindow = Window; // Here we set the network connection observer // This is done by the Reachablity class UpdateStatus (); Reachability.InternetConnectionStatus (); Reachability.LocalWifiConnectionStatus (); Reachability.RemoteHostStatus (); // Main point: The eventhandler when network status changes Reachability.ReachabilityChanged += (object sender, EventArgs e) => { UpdateStatus (); }; storyboard = UIStoryboard.FromName ("MainStoryboard", null); loginController = storyboard.InstantiateInitialViewController () as LoginController; Window.RootViewController = loginController; Window.MakeKeyAndVisible (); return true; }
/// <summary> /// Attachs to purchase manager. /// </summary> /// <param name="purchaseManager">Purchase manager.</param> public void AttachToPurchaseManager(UIStoryboard Storyboard, InAppPurchaseManager purchaseManager) { // Save connection _Storyboard = Storyboard; _purchaseManager = purchaseManager; // Respond to events _purchaseManager.ReceivedValidProducts += (products) => { // Received valid products from the iTunes App Store, // Update the display ReloadData(); }; _purchaseManager.InAppProductPurchased += (transaction, product) => { // Update list to remove any non-consumable products that were // purchased ReloadData(); }; _purchaseManager.InAppPurchasesRestored += (count) => { // Update list to remove any non-consumable products that were // purchased and restored ReloadData(); }; _purchaseManager.TransactionObserver.InAppPurchaseContentDownloadInProgress += (download) => { // Update the table to display the status of any downloads of hosted content // that we currently have in progress so we are forcing a table reload on the // download progress update. Since the final message will be the raising of the // InAppProductPurchased event, we'll just trap it to clear any completed // downloads instead of listening to the InAppPurchaseContentDownloadCompleted on the // purchase managers transaction observer. ReloadData(); // Display download percent in the badge StoreTab.BadgeValue = string.Format ("{0:###}%", _purchaseManager.ActiveDownloadPercent * 100.0f);; }; _purchaseManager.TransactionObserver.InAppPurchaseContentDownloadCompleted += (download) => { // Clear badge StoreTab.BadgeValue = null; }; _purchaseManager.TransactionObserver.InAppPurchaseContentDownloadCanceled += (download) => { // Clear badge StoreTab.BadgeValue = null; }; _purchaseManager.TransactionObserver.InAppPurchaseContentDownloadFailed += (download) => { // Clear badge StoreTab.BadgeValue = null; }; _purchaseManager.TransactionObserver.InAppPurchaseContentDownloadFailed += (download) => { // Inform the user that the download has failed. Normally download would contain // information about the failure that you would want to display to the user, since // we are running in simulation mode download will be null, so just display a // generic failure message. using(var alert = new UIAlertView("Download Failed", "Unable to complete the downloading of content for the product being purchased. Please try again later.", null, "OK", null)) { alert.Show(); } // Force the table to reload to remove current download message ReloadData(); }; _purchaseManager.InAppProductPurchaseFailed += (transaction, product) => { // Inform caller that the purchase of the requested product failed. // NOTE: The transaction will normally encode the reason for the failure but since // we are running in the simulated iTune App Store mode, no transaction will be returned. //Display Alert Dialog Box using(var alert = new UIAlertView("Xamarin.InAppPurchase", String.Format("Attempt to purchase {0} has failed: {1}", product.Title, transaction.Error.ToString()), null, "OK", null)) { alert.Show(); } // Force a reload to clear any locked items ReloadData(); }; // Initially populate the table with information ReloadData (); }
public void NavigateToProductListView() { if (mainStoryBoard == null) mainStoryBoard = UIStoryboard.FromName("Main", null); Navigate("ProductListView", typeof(ProductListView), true, mainStoryBoard); }
public AMSController (IntPtr handle) : base (handle) { _dataService = Locator.Current.GetService<IDataService>(); _storyboard = this.Storyboard; }