public void TrackPage(string pageName) { _tracker.Set(GaiConstants.ScreenName, pageName); var dict = DictionaryBuilder.CreateScreenView().Build(); _tracker.Send(dict); }
public override void ViewDidAppear(bool animated) { base.ViewDidAppear(animated); View.AddGestureRecognizer(HideKeyboardGesture); // This screen name value will remain set on the tracker and sent with // hits until it is set to a new value or to null. Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "EmailEnquiry View"); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); CloseButton.TouchUpInside += CloseButton_TouchUpInside; EmailAddressTextField.ShouldReturn += EmailAddressTextField_ShouldReturn; //CommentsTextView.shouldr += EmailAddressTextField_ShouldReturn; SubmitButton.TouchUpInside += SubmitButton_TouchUpInside; CheckButton.TouchUpInside += CheckButton_TouchUpInside; //keyboard observers // Keyboard popup NSNotificationCenter.DefaultCenter.AddObserver (UIKeyboard.DidShowNotification, KeyBoardUpNotification); // Keyboard Down NSNotificationCenter.DefaultCenter.AddObserver (UIKeyboard.WillHideNotification, KeyBoardDownNotification); View.AddGestureRecognizer(HideKeyboardGesture); }
protected override void StartNewSession() { var builder = DictionaryBuilder.CreateScreenView(); builder.Set("start", GaiConstants.SessionControl); SendHit(builder); }
public override void ViewDidLoad() { base.ViewDidLoad(); if (!string.IsNullOrEmpty(this.titleString)) { this.NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = UIColor.White }; this.Title = this.titleString; } else { UIImage logo = UIImage.FromBundle("adecco-logo-white"); UIImageView imageView = new UIImageView(new System.Drawing.Rectangle(0, 0, 80, 20)); //244 × 60 imageView.Image = logo; this.NavigationItem.TitleView = imageView; } CustomWebViewDelegate _delegate = new CustomWebViewDelegate(activityIndicator); webView.Delegate = _delegate; if (isAboutUs) { this.aboutUs(); } else { var uri = new Uri(urlString.Trim()); var nsurl = new NSUrl(uri.GetComponents(UriComponents.HttpRequestUrl, UriFormat.UriEscaped)); if (nsurl == null) { webView.LoadHtmlString(string.Format("<html><center><font size=+5 color='red'>An error occurred:<br></font></center></html>"), null); return; } webView.LoadRequest(new NSUrlRequest(nsurl)); webView.ScalesPageToFit = true; webView.BackgroundColor = UIColor.White; activityIndicator.HidesWhenStopped = true; activityIndicator.StartAnimating(); } //var userAgent = webView.EvaluateJavascript("navigator.userAgent"); if (this.isJobApply) { Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "Apply Job"); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); } }
public override void ViewDidAppear(bool animated) { base.ViewDidAppear(animated); // This screen name value will remain set on the tracker and sent with // hits until it is set to a new value or to null. Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "Home"); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); }
public void TrackScreen( string screenName, string campaignUrl, List <ProductData> products, ProductActions productAction, ActionData actionData, PromotionData promotion, List <CustomDimension> customDimensions, List <CustomMetric> customMetrics ) { analyticsTracker.Set(GaiConstants.ScreenName, screenName); var builder = DictionaryBuilder.CreateScreenView(); if (customDimensions?.Count > 0) { foreach (var customDimension in customDimensions) { builder.Set(customDimension.DimensionValue, Fields.CustomDimension((nuint)customDimension.DimensionIndex)); } } if (customMetrics?.Count > 0) { foreach (var customMetric in customMetrics) { builder.Set(Convert.ToString(customMetric.MetricValue), Fields.CustomMetric((nuint)customMetric.MetricIndex)); } } if (promotion != null) { builder.AddPromotion(generatePromotion(promotion)); } if (products != null) { foreach (var p in products) { var product = mapper.mapProduct(p); switch (productAction) { case ProductActions.none: builder.AddProductImpression(product, screenName, "App"); break; default: builder.SetProductAction(generateCheckoutProductAction(actionData, productAction)); builder.AddProduct(product); break; } } } analyticsTracker.Send(builder.Build()); }
public void TrackScreen(string screenName) { if (Verbosity == VerbosityLevel.ReportAll) { SetUserIDDimension(); Tracker.Set(GaiConstants.ScreenName, screenName); Tracker.Send(DictionaryBuilder.CreateScreenView().Build()); } }
public override void ViewDidAppear(bool animated) { View.AddGestureRecognizer(HideKeyboardGesture); // This screen name value will remain set on the tracker and sent with // hits until it is set to a new value or to null. Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "RegistrationStepThree View (Registration)"); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. var documents = Environment.GetFolderPath(Environment.SpecialFolder.Personal); _pathToDatabase = Path.Combine(documents, "db_sqlite-net.db"); SQLiteConnection dbConnection = DbHelper.GetConnection(_pathToDatabase, new SQLite.Net.Platform.XamarinIOS.SQLitePlatformIOS()); //DbHelper.CreateDatabaseAndTables(); this.isLoadingMoreData = false; UIImage logo = UIImage.FromBundle("adecco-logo-white"); UIImageView imageView = new UIImageView(new System.Drawing.Rectangle(0, 0, 80, 20)); //244 × 60 imageView.Image = logo; NavigationItem.TitleView = imageView; tblView.Source = new TableSource(jobList, this, this.isFavoriteJob); //#EEEEEE light Grey color this.headerLabel.BackgroundColor = UIColor.White; // this.headerLabel.BackgroundColor = UIColor.Clear.FromHexString("##EEEEEE", 1.0f); if (!isFavoriteJob) { this.FavoriteButtonWithCount(this.NavigationItem); this.headerLabel.Layer.CornerRadius = 0.0f; this.headerLabel.Layer.BorderWidth = 1.0f; this.headerLabel.Layer.BorderColor = UIColor.LightGray.CGColor; this.headerLabel.Text = " " + Constants.JobCount; this.headerLabel.AdjustsFontSizeToFitWidth = true; } else { this.headerLabel.Hidden = true; } tblView.TableFooterView = new UIView(); Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "Job Listing"); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); this.appliedFilterList(); }
public override void ViewDidAppear(bool animated) { base.ViewDidAppear(animated); SpecTableView.FlashScrollIndicators(); PerformSelector(new ObjCRuntime.Selector("demo:"), null, 1); // This screen name value will remain set on the tracker and sent with // hits until it is set to a new value or to null. Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "AdLayout View"); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); }
public override void ViewDidAppear(bool animated) { base.ViewDidAppear(animated); View.AddGestureRecognizer(HideKeyboardGesture); // This screen name value will remain set on the tracker and sent with // hits until it is set to a new value or to null. Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "View Controller"); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); //string url = "https://globalair.com/myaircraft/rates.aspx"; //webView.LoadRequest(new Foundation.NSUrlRequest(new Foundation.NSUrl(url))); //webView.ScalesPageToFit = true; }
public virtual async Task TrackPageViewAsync(string viewName, Dictionary <string, string> properties) { Tracker.Set(GaiConstants.ScreenName, viewName); var viewToTrack = DictionaryBuilder.CreateScreenView().Build(); if (properties != null) { foreach (var property in properties) { viewToTrack.Add(NSObject.FromObject(property.Key), NSObject.FromObject(property.Value)); } } Tracker.Send(viewToTrack); }
public override void TrackScreen(string screenName) { // Set screen name. Tracker.Set(GaiConstants.ScreenName, screenName); // Send a screen view. var screenViewBuilder = DictionaryBuilder.CreateScreenView(); foreach (var key in CustomDimensions.Keys) { Tracker.Set(Fields.CustomDimension((nuint)key), CustomDimensions[key]); } Tracker.Send(screenViewBuilder.Build()); }
public void TrackPageView(string pageName) { try { Debug.WriteLine($"{nameof(TrackPageView)}({pageName})"); Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, pageName); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); } catch (Exception ex) { if (Debugger.IsAttached) { Debugger.Break(); } Debug.WriteLine(ex); } }
public void TrackAppEvent(string Category, string EventAction, string EventLabel) { try { if (numOfTrackerEventHitsInThisSession > 300) { Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); Gai.SharedInstance.Dispatch(); // Manually dispatch the event immediately numOfTrackerEventHitsInThisSession = 0; } else { numOfTrackerEventHitsInThisSession++; } Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateEvent("iOS_" + Category, "iOS_" + EventAction, "iOS_" + EventLabel, null).Build()); Gai.SharedInstance.Dispatch(); // Manually dispatch the event immediately } catch { } }
public void LogViewLoaded(string name) { if (Enabled && _tracker != null) { _tracker.Set(GaiConstants.ScreenName, name); _tracker.Send(DictionaryBuilder.CreateScreenView().Build()); _tracker.Send( DictionaryBuilder.CreateEvent( Constants.Tracking.UserInterfaceEvent, Constants.Tracking.ViewDisplayed, name, null ) .Build() ); _tracker.Set(GaiConstants.ScreenName, null); } }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. //UIImage logo = UIImage.FromBundle("adecco-logo-white"); //UIImageView imageView = new UIImageView(new System.Drawing.Rectangle(0, 0, 80, 20)); //244 × 60 //imageView.Image = logo; //NavigationItem.TitleView = imageView; this.NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = UIColor.White }; this.NavigationController.NavigationItem.BackBarButtonItem = new UIBarButtonItem("Back", UIBarButtonItemStyle.Plain, null); tblView.Source = new BranchLocatorTableSource(this._branchList, this); tblView.ReloadData(); this.titleLabel.BackgroundColor = UIColor.Clear.FromHexString("##EEEEEE", 1.0f); this.titleLabel.Text = string.Format(" We have {0} branches for you!", _branchList.Count); this.NavigationItem.SetRightBarButtonItem( new UIBarButtonItem("Map" , UIBarButtonItemStyle.Done , (sender, args) => { //Map button was clicked this.displayMapView(); }) , true); Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "Branch Listing"); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); }
public void Track_App_Page(String PageNameToTrack) { Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, PageNameToTrack); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); }
public void RastrearPage(string nomePage) { Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, nomePage); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. //UIImage logo = UIImage.FromBundle("adecco-logo-white"); //UIImageView imageView = new UIImageView(new System.Drawing.Rectangle(0, 0, 80, 20)); //244 × 60 //imageView.Image = logo; //NavigationItem.TitleView = imageView; //confirmButton.BackgroundColor = UIColor.Clear.FromHexString("#B93224", 1.0f); this.NavigationItem.SetRightBarButtonItem( new UIBarButtonItem("Confirm" , UIBarButtonItemStyle.Done , (sender, args) => { //Confirm button was clicked this.ConfirmButton_TouchUpInside(); }) , true); btnChckBox.SetImage(UIImage.FromFile("uncheck.png"), UIControlState.Normal); this.NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = UIColor.White }; this.Title = "Job Alert"; /* * tblView.Layer.BorderColor = UIColor.LightGray.CGColor; * tblView.Layer.BorderWidth = 1.5f; * tblView.Layer.CornerRadius = 5f; * tblView.Layer.MasksToBounds = true; * * tblView.Layer.ShadowColor = UIColor.DarkGray.CGColor; * tblView.Layer.ShadowOpacity = 0.4f; * tblView.Layer.ShadowRadius = 2.0f; * tblView.Layer.ShadowOffset = new SizeF(0, 0); //(2.0f, 2.0f); * tblView.Layer.MasksToBounds = false; */ tblView.Tag = 101; tblView.ClipsToBounds = true; //#EEEEEE light Grey color titleLabel.BackgroundColor = UIColor.Clear.FromHexString("##EEEEEE", 1.0f); //#EEEEEE light Grey color View.BackgroundColor = UIColor.Clear.FromHexString("##EEEEEE", 1.0f); //#FFFFFF white color tblView.BackgroundColor = UIColor.Clear.FromHexString("##FFFFFF", 1.0f); //tblView.Layer.BorderColor = UIColor.LightGray.CGColor; //tblView.Layer.BorderWidth = 0.5f; //tblView.Layer.CornerRadius = 2.0f; //tblView.Layer.MasksToBounds = true; _jobAlerts = new List <JobAlert>(); JobAlert aJobAlert = new JobAlert { heading = "Name Job Alert", placeHolder = "B.v.technische functies", inputValue = "" }; JobAlert bJobAlert = new JobAlert { heading = "Frequency", placeHolder = "Daily", inputValue = "Daily" }; JobAlert cJobAlert = new JobAlert { heading = "First Name", placeHolder = "Enter your first name here.", inputValue = "" }; JobAlert dJobAlert = new JobAlert { heading = "Surname", placeHolder = "Enter your surname here.", inputValue = "" }; JobAlert eJobAlert = new JobAlert { heading = "Email", placeHolder = "Enter your email here.", inputValue = "" }; _jobAlerts.Add(aJobAlert); _jobAlerts.Add(bJobAlert); _jobAlerts.Add(cJobAlert); _jobAlerts.Add(dJobAlert); _jobAlerts.Add(eJobAlert); tblView.Source = new TableSource(_jobAlerts, this); tblView.ReloadData(); //tblView.TableFooterView = new UIView(); //tblView.TableHeaderView = new UIView(); tblView.ScrollEnabled = true; // Setup keyboard event handlers RegisterForKeyboardNotifications(); this.appliedFilterList(); Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "Job Alert"); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); }
public void SendScreen(string screenName) { Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, screenName); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); }
public void SetScreenName(GaScreenNameMessage message) { Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, message.ScreenName); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); }
public void TrackScreen(ScreenName screen) { tracker.Set(GaiConstants.ScreenName, screen.ToString()); tracker.Send(DictionaryBuilder.CreateScreenView().Build()); gaInstance.Dispatch(); }
public void TrackScreenView(string screenName, Boolean online) { Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, (online ? "" : OFFLINE) + " - " + screenName); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. //UIImage logo = UIImage.FromBundle("adecco-logo-white"); //UIImageView imageView = new UIImageView(new System.Drawing.Rectangle(0, 0, 80, 20)); //244 × 60 //imageView.Image = logo; //NavigationItem.TitleView = imageView; this.NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = UIColor.White }; //#EEEEEE light Grey color View.BackgroundColor = UIColor.Clear.FromHexString("##EEEEEE", 1.0f); //#FFFFFF white color bgView.BackgroundColor = UIColor.Clear.FromHexString("##FFFFFF", 1.0f); bgView.Layer.BorderColor = UIColor.LightGray.CGColor; bgView.Layer.BorderWidth = 0.5f; bgView.Layer.CornerRadius = 2.0f; bgView.Layer.MasksToBounds = true; txtLocation.Tag = 1032; txtLocation.TextColor = UIColor.DarkGray; txtLocation.Font = UIFont.SystemFontOfSize(16); txtDistance.TextColor = UIColor.DarkGray; txtDistance.Font = UIFont.SystemFontOfSize(16); txtDistance.Text = "25 Km"; btnsearch.Layer.CornerRadius = 2.0f; activityIndicatorLocation.Hidden = true; activityIndicatorLocation.StopAnimating(); //this.txtLocation.LeftViewMode = UITextFieldViewMode.Always; //this.txtLocation.LeftView = new UIView(new RectangleF(0, 0, 35, 35)); //imageViewKeyword; //this.txtDistance.LeftViewMode = UITextFieldViewMode.Always; //this.txtDistance.LeftView = new UIView(new RectangleF(0, 0, 35, 35)); //imageViewLocation; this.txtLocation.AttributedPlaceholder = new NSAttributedString( Translations.Bl_Place, font: UIFont.SystemFontOfSize(16), foregroundColor: UIColor.DarkGray, strokeWidth: 0 ); this.txtDistance.AttributedPlaceholder = new NSAttributedString( Translations.Bl_Distance, font: UIFont.SystemFontOfSize(16), foregroundColor: UIColor.DarkGray, strokeWidth: 0 ); txtDistance.ShouldReturn += TextFieldShouldReturn; txtLocation.ShouldReturn += TextFieldShouldReturn; txtDistance.ShouldClear += TextFieldShoulClear; txtLocation.ShouldClear += TextFieldShoulClear; txtLocation.ShouldBeginEditing += ShouldBeginEditing; txtDistance.ShouldBeginEditing += ShouldBeginEditing; NSNotificationCenter.DefaultCenter.AddObserver(UITextField.TextFieldTextDidChangeNotification, TextFieldTextDidChangeNotification); lblPlace.Text = Translations.Bl_Place; lblDistance.Text = Translations.Bl_Distance; btnsearch.SetTitle(Translations.Bl_Search, UIControlState.Normal); btnsearch.SetTitle(Translations.Bl_Search, UIControlState.Highlighted); //btnJobSearch.TouchUpInside += JobSearchButtonPressed; Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "Branch Locator"); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); }
public void TrackPage(string pageName) { _tracker.Set("kGAIScreenName", pageName); _tracker.Send(DictionaryBuilder.CreateScreenView().Build()); }
public override void ViewDidLoad() { base.ViewDidLoad(); this.NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = UIColor.White }; this.Title = "Refine"; /* * this.NavigationItem.SetLeftBarButtonItem( * new UIBarButtonItem("Reset" * , UIBarButtonItemStyle.Done * , (sender, args) => * { * //Apply button was clicked * //var sfViewController = new SFSafariViewController(new NSUrl(this.aJobDetail.ApplyUri)); * //PresentViewControllerAsync(sfViewController, true); * var alert = UIAlertController.Create("Adecco Nederland", "Are you sure ? You want to remove all the filter.", UIAlertControllerStyle.Alert); * * alert.AddAction(UIAlertAction.Create("No Thanks", UIAlertActionStyle.Default, null)); * alert.AddAction(UIAlertAction.Create("YES", UIAlertActionStyle.Default, action => resetFilterHandler())); * * PresentViewController(alert, animated: true, completionHandler: null); * * * }) * , true); */ this.NavigationItem.SetRightBarButtonItem( new UIBarButtonItem("RESET" , UIBarButtonItemStyle.Done , (sender, args) => { //Reset button was clicked var alert = UIAlertController.Create("Adecco Nederland", "Are you sure ? You want to remove all the filter.", UIAlertControllerStyle.Alert); alert.AddAction(UIAlertAction.Create("No Thanks", UIAlertActionStyle.Default, null)); alert.AddAction(UIAlertAction.Create("YES", UIAlertActionStyle.Default, action => resetFilterHandler())); PresentViewController(alert, animated: true, completionHandler: null); }) , true); //#EEEEEE light Grey color //View.BackgroundColor = UIColor.Clear.FromHexString("##EEEEEE", 1.0f); btnApply.BackgroundColor = UIColor.Red; //UIColor.Clear.FromHexString("#ef2e24", 1.0f); //#FFFFFF white color //Table.BackgroundColor = UIColor.Clear.FromHexString("##FFFFFF", 1.0f); //Table.Layer.BorderColor = UIColor.LightGray.CGColor; //Table.Layer.BorderWidth = 0.5f; //Table.Layer.CornerRadius = 2.0f; //Table.Layer.MasksToBounds = true; //Table.ClipsToBounds = true; Table.Source = new ExpandableTableSource(this.presentationFacetResultList, Table, this); this.appliedFilterList(); // show radius slider if location exist only if (jobRequest.FilterURL.Contains("&xy")) { footerView.Hidden = false; } else { footerView.Hidden = true; } //Constants.selectedRadius = "&r=" + selectedRadius; string[] tokens = Constants.selectedRadius.Split(new[] { "=" }, StringSplitOptions.None); float radius = float.Parse(tokens[1], CultureInfo.InvariantCulture.NumberFormat); radiusSlider.SetValue(radius, true); lblRadius.Text = string.Format("Distance {0} Kilometers", tokens[1]); radiusSlider.Continuous = false; radiusSlider.TouchUpInside += (o, e) => { int kSliderInterval = 5; double sliderValue = kSliderInterval * Math.Floor((radiusSlider.Value / kSliderInterval) + 0.5); var selectedRadius = Convert.ToInt32(sliderValue); radiusSlider.SetValue((float)sliderValue, true); Constants.isFileterApplied = true; //var selectedRadius = Convert.ToInt32(radiusSlider.Value); lblRadius.Text = string.Format("Distance {0} Kilometers", selectedRadius); // &r=25" this.radiusValueChanged(selectedRadius.ToString()); }; radiusSlider.ValueChanged += (o, e) => { var selectedRadius = Convert.ToInt32(radiusSlider.Value); lblRadius.Text = string.Format("Beam {0} mileage", selectedRadius); }; AppDelegate appDelegate = (AppDelegate)UIApplication.SharedApplication.Delegate; appDelegate.SidebarController.Disabled = true; Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "Refine"); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); }
public void TrackScreen(string screenName) { Tracker?.Set(GaiConstants.ScreenName, screenName); Tracker?.Send(DictionaryBuilder.CreateScreenView().Build()); }
public override void ViewDidAppear(bool animated) { base.ViewDidAppear(animated); // This screen name value will remain set on the tracker and sent with // hits until it is set to a new value or to null. Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "MagazineFlip View"); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateScreenView().Build()); if (NavigateDirectlyToAdId != null && NavigateDirectlyToAdId != string.Empty) { var pageViewController = this.PageViewController; var magFlipBoardViewController = this; Ad ad = new Ad(); var adList = ModelController.adList; ad = adList.FirstOrDefault(row => row.ID == NavigateDirectlyToAdId); NavigateDirectlyToAdId = null; if (ad != null && ad.ID != string.Empty) { //this.View.AddSubview(loadingIndicator); var modelController = this.ModelController; List <Ad> searchAddList = new List <Ad>(); Task.Run(async() => { searchAddList = (await Ad.GetAdsByClassificationAsync(ad.Classification)).ToList(); //get ads with this name and move them to the from of the liste List <Ad> similarAdList = new List <Ad>(); similarAdList = searchAddList.Where(row => row.Name == ad.Name).OrderBy(r => r.IsFeatured).ToList(); //similarAdList.Remove(ad); for (int i = 0; i < similarAdList.Count(); i++) { searchAddList.Remove(similarAdList[i]); searchAddList.Insert(0, similarAdList[i]); } //similarAdList.Remove(ad); //searchAddList.Insert(0, ad); var index = searchAddList.FindIndex(x => x.ID == ad.ID); var item = searchAddList[index]; searchAddList[index] = searchAddList[0]; searchAddList[0] = item; InvokeOnMainThread(() => { modelController.LoadModalController(searchAddList, ad.Classification); var initialViewController = modelController.GetViewController(0, false); var searchViewControllers = new UIViewController[] { initialViewController }; pageViewController.SetViewControllers(searchViewControllers, UIPageViewControllerNavigationDirection.Forward, true, (finished) => { if (LoadingIndicator != null) { LoadingIndicator.Hide(); } }); //HelperMethods.SendBasicAlert("", "Aircraft arranged based on search selection"); }); }); } else { if (LoadingIndicator != null) { LoadingIndicator.Hide(); } } } ; }