/// <summary>
		/// Views the did load.
		/// </summary>
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			// Register the tableview's datasource
			TableView.Source = new MainMenuTableSource (this);

			// Create a search results table
			var searchResultsController = new UITableViewController (UITableViewStyle.Plain);
			var searchSource = new SearchResultsTableSource (this);
			searchResultsController.TableView.Source = searchSource;

			// Create search updater and wire it up
			var searchUpdater = new SearchResultsUpdator ();
			searchUpdater.UpdateSearchResults += (searchText) => {
				// Preform search and reload search table
				searchSource.Search(searchText);
				searchResultsController.TableView.ReloadData();
			};

			// Create a new search controller
			SearchController = new UISearchController (searchResultsController);
			SearchController.SearchResultsUpdater = searchUpdater;

			// Display the search controller
			SearchController.SearchBar.Frame = new CGRect (SearchController.SearchBar.Frame.X, SearchController.SearchBar.Frame.Y, SearchController.SearchBar.Frame.Width, 44f);
			TableView.TableHeaderView = SearchController.SearchBar;
			DefinesPresentationContext = true;
		}
		/// <summary>
		/// Shows the search controller.
		/// </summary>
		public void ShowSearchController ()
		{
			// Build an instance of the Search Results View Controller from the Storyboard
			ResultsController = Storyboard.InstantiateViewController (SearchResultsID) as SearchResultsViewController;
			if (ResultsController == null)
				throw new Exception ("Unable to instantiate a SearchResultsViewController.");

			// Create an initialize a new search controller
			var searchController = new UISearchController (ResultsController) {
				SearchResultsUpdater = ResultsController,
				HidesNavigationBarDuringPresentation = false
			};

			// Set any required search parameters
			searchController.SearchBar.Placeholder = "Enter keyword (e.g. coffee)";

			// The Search Results View Controller can be presented as a modal view
			// PresentViewController (searchController, true, null);

			// Or in the case of this sample, the Search View Controller is being
			// presented as the contents of the Search Tab directly. Use either one
			// or the other method to display the Search Controller (not both).
			var container = new UISearchContainerViewController (searchController);
			var navController = new UINavigationController (container);
			AddChildViewController (navController);
			View.Add (navController.View);
		}
		public override void ViewDidLoad () {
			base.ViewDidLoad ();

			this.longPressRecognizer = new UILongPressGestureRecognizer (() => {
				if (this.longPressRecognizer.NumberOfTouches > 0) {
					var point = this.longPressRecognizer.LocationOfTouch (0, this.cvSpotlight);
					var indexPath = this.cvSpotlight.IndexPathForItemAtPoint (point);
					if (indexPath != null) {
						var cell = this.cvSpotlight.CellForItem (indexPath) as IMovieCell;
						if (this.longPressRecognizer.State == UIGestureRecognizerState.Began) {
							cell.SetHighlighted (true, true);
						} else if (this.longPressRecognizer.State == UIGestureRecognizerState.Ended) {
							cell.SetHighlighted (false, true, () => {
								var movie = this.spotlight [indexPath.Row];
								Data.Current.ToggleFavorite (movie);
							});
						}
					} else {
						foreach (MovieCollectionViewCell cell in this.cvSpotlight.VisibleCells)
							cell.SetHighlighted (false, false);
					}
				} 
			});
			this.cvSpotlight.AddGestureRecognizer (this.longPressRecognizer);

			var searchResults = PresentationUtility.CreateFromStoryboard<SearchResultsTableViewController> ("SearchResults");
			this.search = new UISearchController (searchResults);
			this.search.SearchResultsUpdater = this;
			this.search.DimsBackgroundDuringPresentation = false;
			this.search.DefinesPresentationContext = true;
			searchResults.TableView.TableHeaderView = this.search.SearchBar;
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			resultsTableController = new ResultsTableController {
				FilteredProducts = new List<Product> ()
			};

			searchController = new UISearchController (resultsTableController) {
				WeakDelegate = this,
				DimsBackgroundDuringPresentation = false,
				WeakSearchResultsUpdater = this
			};

			searchController.SearchBar.SizeToFit ();
			TableView.TableHeaderView = searchController.SearchBar;

			resultsTableController.TableView.WeakDelegate = this;
			searchController.SearchBar.WeakDelegate = this;

			DefinesPresentationContext = true;

			if (searchControllerWasActive) {
				searchController.Active = searchControllerWasActive;
				searchControllerWasActive = false;

				if (searchControllerSearchFieldWasFirstResponder) {
					searchController.SearchBar.BecomeFirstResponder ();
					searchControllerSearchFieldWasFirstResponder = false;
				}
			}
		}
        public async override void ViewDidLoad()
		{
			base.ViewDidLoad();

			await SampleManager.Current.InitializeAsync();
			var data = SampleManager.Current.GetSamplesAsTree();
			this.TableView.Source = new CategoryDataSource(this, data);

			this.TableView.ReloadData();

            var searchResultsController = new SearchResultsViewController(this, data);

            // Create search updater and wire it up
            var searchUpdater = new SearchResultsUpdater();
            searchUpdater.UpdateSearchResults += searchResultsController.Search;

            // Create a new search controller
            SearchController = new UISearchController(searchResultsController);
            SearchController.SearchResultsUpdater = searchUpdater;

            // Display the search controller
            SearchController.SearchBar.Frame = new CGRect(SearchController.SearchBar.Frame.X, SearchController.SearchBar.Frame.Y, SearchController.SearchBar.Frame.Width, 44f);
            TableView.TableHeaderView = SearchController.SearchBar;
            DefinesPresentationContext = true;

        }
		public void UpdateSearchResultsForSearchController (UISearchController searchController)
		{
			//костыль для отображения все станций или для отображения пустоты при инициализиции поиска
				if (_showAll && searchController.SearchResultsController.View.Hidden) {
				searchController.SearchResultsController.View.Hidden = false;
			}
			viewModel.UpdateFilteredStations (searchController.SearchBar.Text);
			TableView.ReloadData ();
		}
		public void UpdateSearchResultsForSearchController (UISearchController searchController)
		{
			// UpdateSearchResultsForSearchController is called when the controller is being dismissed
			// to allow those who are using the controller they are search as the results controller a chance to reset their state.
			// No need to update anything if we're being dismissed.
			if (!searchController.Active)
				return;

			ApplyFilter (searchController.SearchBar.Text);
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			locationManager.RequestWhenInUseAuthorization ();

			// set map type and show user location
			map.MapType = MKMapType.Standard;
			map.ShowsUserLocation = true;
			map.Bounds = View.Bounds;

			// set map center and region
			const double lat = 42.374260;
			const double lon = -71.120824;
			var mapCenter = new CLLocationCoordinate2D (lat, lon);
			var mapRegion = MKCoordinateRegion.FromDistance (mapCenter, 2000, 2000);
			map.CenterCoordinate = mapCenter;
			map.Region = mapRegion;

			// add an annotation
			map.AddAnnotation (new MKPointAnnotation {
				Title = "MyAnnotation", 
				Coordinate = new CLLocationCoordinate2D (42.364260, -71.120824)
			});

			// set the map delegate
			mapDel = new MyMapDelegate ();
			map.Delegate = mapDel;

			// add a custom annotation
			map.AddAnnotation (new MonkeyAnnotation ("Xamarin", mapCenter));

			// add an overlay
			var circleOverlay = MKCircle.Circle (mapCenter, 1000);
			map.AddOverlay (circleOverlay);

			var searchResultsController = new SearchResultsViewController (map);


			var searchUpdater = new SearchResultsUpdator ();
			searchUpdater.UpdateSearchResults += searchResultsController.Search;

			//add the search controller
			searchController = new UISearchController (searchResultsController) {
				SearchResultsUpdater = searchUpdater
			};

			searchController.SearchBar.SizeToFit ();
			searchController.SearchBar.SearchBarStyle = UISearchBarStyle.Minimal;
			searchController.SearchBar.Placeholder = "Enter a search query";

			searchController.HidesNavigationBarDuringPresentation = false;
			NavigationItem.TitleView = searchController.SearchBar;
			DefinesPresentationContext = true;
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			searchController = new UISearchController ((UITableViewController)null);
			searchController.DimsBackgroundDuringPresentation = false;
			this.TableView.TableHeaderView = searchController.SearchBar;
			searchController.SearchBar.SizeToFit ();
			DefinesPresentationContext = true;
			searchController.SearchResultsUpdater = this;
			this.TableView.SetContentOffset (new CoreGraphics.CGPoint (0, searchController.SearchBar.Frame.Size.Height), animated: false);
			searchController.SearchBar.BarTintColor = UIColorExtensions.FromHex (Vm.Conference.HighlightColor);
		}
		public void SearchButtonClicked (UIBarButtonItem sender)
		{
			// Create the search results view controller and use it for the UISearchController.
			var searchResultsController = (SearchResultsViewController)Storyboard.InstantiateViewController (SearchResultsViewController.StoryboardIdentifier);

			// Create the search controller and make it perform the results updating.
			searchController = new UISearchController (searchResultsController);
			searchController.SetSearchResultsUpdater (searchResultsController.UpdateSearchResultsForSearchController);
			searchController.HidesNavigationBarDuringPresentation = false;

			// Present the view controller.
			PresentViewController (searchController, true, null);
		}
		partial void ShowSearchController (NSObject sender)
		{
			var resultsController = Storyboard.InstantiateViewController (SearchResultsViewController.StoryboardIdentifier) as SearchResultsViewController;
			if (resultsController == null)
				throw new Exception ("Unable to instantiate a SearchResultsViewController.");

			var searchController = new UISearchController (resultsController) {
				SearchResultsUpdater = resultsController,
				HidesNavigationBarDuringPresentation = false
			};

			searchController.SearchBar.Placeholder = "Enter keyword (e.g. iceland)";
			SplitViewController?.PresentViewController (searchController, true, null);
		}
Exemple #12
0
		public void SearchButtonClicked(UIBarButtonItem sender)
		{
			// Create the search results view controller and use it for the UISearchController.
			SearchResultsViewController searchResultsController = (SearchResultsViewController)Storyboard.InstantiateViewController (SearchResultsViewController.StoryboardIdentifier);
			UISearchResultsUpdatingWrapper wrapper = new UISearchResultsUpdatingWrapper (searchResultsController);

			// Create the search controller and make it perform the results updating.
			_searchController = new UISearchController (searchResultsController);
			// TODO: need overload https://trello.com/c/bEtup8us
			_searchController.SearchResultsUpdater = wrapper;
			_searchController.HidesNavigationBarDuringPresentation = false;

			// Present the view controller.
			PresentViewController (_searchController, true, null);
		}
Exemple #13
0
        protected virtual void CreateSearchController()
        {
            SearchController = new UISearchController(searchResultsController: null)
            {
                HidesNavigationBarDuringPresentation = false,
                ObscuresBackgroundDuringPresentation = false
            };

            SearchController.SearchBar.TextChanged += (s, e) =>
            {
                ViewModel.SearchLine = ((UISearchBar)s).Text;
            };
            SearchController.SearchBar.CancelButtonClicked += (s, e) =>
            {
                ViewModel.SearchLine = ((UISearchBar)s).Text = string.Empty;
            };
        }
Exemple #14
0
        void InitializeComponents()
        {
            tweets = new List <Status>();
            LinqToTwitterManager.SharedInstance.TweetsFetchedEvent       += SharedInstance_TweetsFetchedEvent1;
            LinqToTwitterManager.SharedInstance.FetchedTweetsFailedEvent += SharedInstance_FetchedTweetsFailedEvent1;

            searchController = new UISearchController(searchResultsController: null)
            {
                SearchResultsUpdater             = this,
                DimsBackgroundDuringPresentation = false
            };
            TweetTableView.DataSource         = this;
            TweetTableView.Delegate           = this;
            TweetTableView.TableHeaderView    = searchController.SearchBar;
            TweetTableView.RowHeight          = UITableView.AutomaticDimension;
            TweetTableView.EstimatedRowHeight = 50;
        }
Exemple #15
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            SampleManager.Current.Initialize();
            List <SearchableTreeNode> data = SampleManager.Current.FullTree.Items.OfType <SearchableTreeNode>().ToList();

            TableView.Source = new CategoryDataSource(this, data);

            TableView.ReloadData();

            var searchResultsController = new SearchResultsViewController(this);

            // Create search updater and wire it up
            var searchUpdater = new SearchResultsUpdater();

            searchUpdater.UpdateSearchResults += searchResultsController.Search;

            // Create a new search controller
            SearchController = new UISearchController(searchResultsController)
            {
                SearchResultsUpdater = searchUpdater
            };

            // Show the search bar in the navigation/header area
            NavigationItem.SearchController = SearchController;
            UITextField entry = SearchController.SearchBar.ValueForKey(new NSString("searchField")) as UITextField;

            if (entry != null)
            {
                var backgroundView = entry.Subviews.FirstOrDefault();
                if (backgroundView != null)
                {
                    backgroundView.Layer.CornerRadius = 10;
                    backgroundView.ClipsToBounds      = true;
                }
            }

            // Show search bar by default
            NavigationItem.HidesSearchBarWhenScrolling = false;

            NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIImage.FromBundle("Settings"), UIBarButtonItemStyle.Plain, ViewSettingsPage);

            DefinesPresentationContext = true;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _dataSource = SelectionMenuDataSourceFactory.CreateDataSource(TableView, this, (tableView, item) =>
                                                                          (SelectionTableViewCell)tableView.DequeueReusableCell(nameof(SelectionTableViewCell)));

            _dataSource.Items = _items;

            _dataSource.SelectItem(_items[0]);

            TableView.DataSource      = _dataSource;
            TableView.TableFooterView = new UIView();


            var searchController = new UISearchController((UIViewController)null);

            searchController.ObscuresBackgroundDuringPresentation = false;
            searchController.SearchBar.Placeholder                = "Search...";
            searchController.SearchBar.AutocapitalizationType     = UITextAutocapitalizationType.None;
            searchController.HidesNavigationBarDuringPresentation = false;
            searchController.SearchBar.TextChanged               += (sender, args) =>
            {
                if (args.SearchText.Length >= 2)
                {
                    var query = args.SearchText.ToLowerInvariant();
                    _dataSource.ApplyFilter(i => i.Name.ToLowerInvariant().Contains(query));
                }
                else
                {
                    _dataSource.ClearFilter();
                }
            };

            DefinesPresentationContext = true;


            NavigationItem.LeftBarButtonItem = new UIBarButtonItem("Close", UIBarButtonItemStyle.Plain,
                                                                   (sender, args) => SetResult(Array.Empty <SampleItem>()));

            NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Done,
                                                                    (sender, args) => SetResult(_dataSource.SelectedItems));

            NavigationItem.SearchController = searchController;
        }
        public override void WillMoveToParentViewController(UIViewController parent)
        {
            base.WillMoveToParentViewController(parent);

            var searchController = new UISearchController(searchResultsController: null)
            {
                SearchResultsUpdater                 = this,
                DimsBackgroundDuringPresentation     = false,
                HidesNavigationBarDuringPresentation = false,
                HidesBottomBarWhenPushed             = true
            };

            searchController.SearchBar.Placeholder = string.Empty;

            parent.NavigationItem.SearchController = searchController;

            DefinesPresentationContext = true;
        }
        public void UpdateSearchResultsForSearchController(UISearchController searchController)
        {
            // Strip out all the leading and trailing spaces.
            var searchItems = searchController.SearchBar.Text.Trim().Split(' ');

            /* here you can choose the way how to do search */

            var filteredResults = this.PerformSearch_Swift(searchItems);

            //var filteredResults = this.PerformSearch_CSharp(searchItems);

            // Apply the filtered results to the search results table.
            if (searchController.SearchResultsController is ResultsTableController resultsController)
            {
                resultsController.FilteredProducts = filteredResults;
                resultsController.TableView.ReloadData();
            }
        }
        public override async void ViewDidLoad()
        {
            base.ViewDidLoad();

            searchController = new UISearchController((UIViewController)null);
            searchController.SearchResultsUpdater       = this;
            searchController.DefinesPresentationContext = true;
            searchController.SearchBar.Delegate         = this;
            searchController.SearchBar.SizeToFit();

            tableView = new UITableView(View.Bounds, UITableViewStyle.Plain);
            tableView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            tableView.Delegate         = this;
            tableView.DataSource       = this;
            tableView.TableHeaderView  = searchController.SearchBar;

            View.AddSubview(tableView);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Create the search controller, but we'll make sure that this SearchShowResultsInSourceViewController
            // performs the results updating.

            searchController = new UISearchController((UIViewController)null);
            searchController.SetSearchResultsUpdater(UpdateSearchResultsForSearchController);
            searchController.DimsBackgroundDuringPresentation = false;

            // Make sure the that the search bar is visible within the navigation bar.
            searchController.SearchBar.SizeToFit();

            // Include the search controller's search bar within the table's header view.
            TableView.TableHeaderView  = searchController.SearchBar;
            DefinesPresentationContext = true;
        }
        public override void WillMoveToParentViewController(UIViewController parent)
        {
            base.WillMoveToParentViewController(parent);

            if (_searchController == null)
            {
                _searchController = new UISearchController(searchResultsController: null)
                {
                    HidesNavigationBarDuringPresentation = false,
                    DimsBackgroundDuringPresentation     = false
                };

                _searchController.SearchResultsUpdater = this;

                parent.NavigationItem.SearchController            = _searchController;
                parent.NavigationItem.HidesSearchBarWhenScrolling = false;
            }
        }
        partial void ShowSearchController(NSObject sender)
        {
            var resultsController = Storyboard.InstantiateViewController(SearchResultsViewController.StoryboardIdentifier) as SearchResultsViewController;

            if (resultsController == null)
            {
                throw new Exception("Unable to instantiate a SearchResultsViewController.");
            }

            var searchController = new UISearchController(resultsController)
            {
                SearchResultsUpdater = resultsController,
                HidesNavigationBarDuringPresentation = false
            };

            searchController.SearchBar.Placeholder = "Enter keyword (e.g. iceland)";
            SplitViewController?.PresentViewController(searchController, true, null);
        }
Exemple #23
0
        public void UpdateSearchResultsForSearchController(UISearchController searchController)
        {
            var text = searchController.SearchBar.Text;

            if (searchController.Active)
            {
                var filteredList = _conferences.Where(p =>
                                                      CultureInfo.CurrentCulture.CompareInfo.IndexOf
                                                          (p.Name, text, CompareOptions.IgnoreCase) >= 0).ToList();
                _filteredConferences = new ObservableCollection <Conference> (filteredList);
            }
            else
            {
                _filteredConferences = _conferences;
            }

            TableView.ReloadData();
        }
		public void UpdateSearchResultsForSearchController (UISearchController searchController)
		{
			var text = searchController.SearchBar.Text;
			if (searchController.Active) {
				FilteredSessions = Vm
				.Conference
				.Sessions
				.Where (
					x => CultureInfo.CurrentCulture.CompareInfo.IndexOf (x.Title, text, CompareOptions.IgnoreCase) >= 0
					|| x.Speakers.Any (s => CultureInfo.CurrentCulture.CompareInfo.IndexOf (s.LastName, text, CompareOptions.IgnoreCase) >= 0)
				)
				.ToList ();
			} else {
				FilteredSessions = Vm.Conference.Sessions;
			}

			TableView.ReloadData ();
		}
Exemple #25
0
        public void UpdateSearchResultsForSearchController(UISearchController searchController)
        {
            if (searchController.Active)
            {
                filteredAds = new List <Ad>();
            }
            else
            {
                filteredAds = null;
            }

            var textToSearchFor = searchController.SearchBar.Text;
            var index           = searchController.SearchBar.SelectedScopeButtonIndex;



            FilterContentForSearchText(searchController.SearchBar.Text);
        }
        void InitialComponent()
        {
            TodosTweets = new List <Status>();

            Linq2TwitterControlador.SharedInstance.GetTweets      += TraerTweets_GetTweets;
            Linq2TwitterControlador.SharedInstance.ErrorGetTweets += TraerTweets_GetTweetFailed;

            BarraBusqueda = new UISearchController(searchResultsController: null)
            {
                SearchResultsUpdater             = this,
                DimsBackgroundDuringPresentation = false
            };

            tblView.RowHeight       = UITableView.AutomaticDimension;
            tblView.DataSource      = this;
            tblView.Delegate        = this;
            tblView.TableHeaderView = BarraBusqueda.SearchBar;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.resultsTableController = new ResultsTableController();
            this.resultsTableController.TableView.Delegate = this;

            this.searchController = new UISearchController(this.resultsTableController)
            {
                SearchResultsUpdater = this
            };
            this.searchController.SearchBar.AutocapitalizationType = UITextAutocapitalizationType.None;

            if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
            {
                // For iOS 11 and later, place the search bar in the navigation bar.
                base.NavigationItem.SearchController = this.searchController;

                // Make the search bar always visible.
                base.NavigationItem.HidesSearchBarWhenScrolling = false;
            }
            else
            {
                // For iOS 10 and earlier, place the search controller's search bar in the table view's header.
                base.TableView.TableHeaderView = this.searchController.SearchBar;
            }

            this.searchController.Delegate = this;
            this.searchController.DimsBackgroundDuringPresentation = false; // The default is true.
            this.searchController.SearchBar.Delegate = this;                // Monitor when the search button is tapped.

            /*
             * Search presents a view controller by applying normal view controller presentation semantics.
             * This means that the presentation moves up the view controller hierarchy until it finds the root
             * view controller or one that defines a presentation context.
             */

            /*
             * Specify that this view controller determines how the search controller is presented.
             * The search controller should be presented modally and match the physical size of this view controller.
             */

            this.DefinesPresentationContext = true;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            AutomaticallyAdjustsScrollViewInsets = false;
            searchResultControler = new ResultsTableController();
            searchResultControler.RowWasSelected += RowWasSelected;
            UISearchController searchController = new UISearchController(searchResultControler);

            searchController.WeakSearchResultsUpdater = this;

            searchController.DimsBackgroundDuringPresentation = false;

            searchController.SearchBar.SizeToFit();
            TableView.TableHeaderView = searchController.SearchBar;

            DefinesPresentationContext = true;
            searchController.SearchBar.WeakDelegate = this;
            searchController.Active = true;
        }
Exemple #29
0
        /*public void UpdateSearchResultsForSearchController (UISearchController searchController)
         * {
         *
         * }*/

        void InitializeComponents()
        {
            tweets = new List <Status> ();
            Linq2TwitterManager.SharedInstance.TweetsFetched       += Linq2TwitterManager_TweetsFetched;
            Linq2TwitterManager.SharedInstance.FailedTweetsFetched += Linq2TwitterManager_FailedTweetsFetched;

            searchController = new UISearchController(searchResultsController: null)
            {
                //SearchResultsUpdater =this,
                DimsBackgroundDuringPresentation = false,
            };
            searchController.SearchBar.SearchButtonClicked += (sender, e) => {
                Linq2TwitterManager.SharedInstance.SearchTweets(searchController.SearchBar.Text);
            };
            TableView.TableHeaderView    = searchController.SearchBar;
            TableView.RowHeight          = UITableView.AutomaticDimension;
            TableView.EstimatedRowHeight = 60;
            //TableView.TableHeaderView
        }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			// Create the search controller, but we'll make sure that this SearchShowResultsInSourceViewController
			// performs the results updating.

			searchController = new UISearchController ((UIViewController)null);
			searchController.SetSearchResultsUpdater (UpdateSearchResultsForSearchController);
			searchController.DimsBackgroundDuringPresentation = false;

			// Make sure the that the search bar is visible within the navigation bar.
			searchController.SearchBar.SizeToFit ();

			// Include the search controller's search bar within the table's header view.
			TableView.TableHeaderView = searchController.SearchBar;

			DefinesPresentationContext = true;
		}
        void inicializarComponentes()
        {
            tweets = new List <Status>();

            linQtoTwitter.SharedInstance.TweetsFetched     += SharedInstance_TweetsFetched;
            linQtoTwitter.SharedInstance.FetchTweetsFailed += SharedInstance_FetchTweetsFailed;

            searchController = new UISearchController(searchResultsController: null)
            {
                SearchResultsUpdater             = this,
                DimsBackgroundDuringPresentation = false
            };

            tableViewTewwt.DataSource         = this;
            tableViewTewwt.Delegate           = this;
            tableViewTewwt.TableHeaderView    = searchController.SearchBar;
            tableViewTewwt.RowHeight          = UITableView.AutomaticDimension;
            tableViewTewwt.EstimatedRowHeight = 70;
        }
        public override void WillMoveToParentViewController(UIKit.UIViewController parent)
        {
            base.WillMoveToParentViewController(parent);
            if (Element is ISearchControllerPage searchView)
            {
                var searchController = new UISearchController(searchResultsController: null)
                {
                    HidesNavigationBarDuringPresentation = false,
                    DimsBackgroundDuringPresentation     = false,
                    //ObscuresBackgroundDuringPresentation = true
                };

                searchController.SearchBar.SearchBarStyle           = UISearchBarStyle.Prominent;
                searchController.SearchBar.Placeholder              = _transService.Translate("Search or add");
                parent.NavigationItem.SearchController              = searchController;
                searchController.SearchBar.ShowsSearchResultsButton = true;
                searchController.SearchBar.ShowsCancelButton        = false;
                var tf = searchController.SearchBar.ValueForKey(new Foundation.NSString("_searchField")) as UITextField;

                if (tf != null)
                {
                    tf.ClearButtonMode = UITextFieldViewMode.Never;
                    tf.ReturnKeyType   = UIReturnKeyType.Send;
                }

                searchController.SearchBar.SearchButtonClicked += (sender, e) =>
                {
                    searchView.SearchHandler.AddItem();
                    searchController.SearchBar.Text = String.Empty;
                };

                searchController.SearchBar.TextChanged += (sender, e) =>
                {
                    searchView.SearchHandler.Search(e.SearchText);
                };

                searchController.SearchBar.CancelButtonClicked += (sender, e) =>
                {
                    searchView.SearchHandler.Clear();
                };
            }
        }
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            if (searchController != null)
            {
                searchController.Dispose();
                searchController = null;
            }

            if (mapViewDelegate != null)
            {
                mapViewDelegate.Dispose();
                mapViewDelegate = null;
            }

            if (locationManager != null)
            {
                locationManager.Dispose();
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // var storyboard = UIStoryboard.FromName("SearchResults", null);
            // _searchResultsController = storyboard.InstantiateInitialViewController();

            _searchController = new UISearchController(_searchResultsController)
            {
                AutomaticallyShowsCancelButton = false
            };

            /* _searchController.SearchBar.Delegate = this;
             *
             * if (Element.BindingContext is SearchViewModel viewModel)
             *   viewModel.Suggestions.CollectionChanged += OnSuggestionsChanged;
             *
             * if (_searchResultsController is SearchResultsViewController viewController)
             *   viewController.SuggestionSelected += OnSuggestionSelected;*/
        }
        public override void LayoutSubviews()
        {
            base.LayoutSubviews();

            var searchController = new UISearchController(searchResultsController: null);

            try
            {
                MvxFluentBindingDescriptionSet <IndexTableCell, Recipe> set = new MvxFluentBindingDescriptionSet <IndexTableCell, Recipe>(this);
                set.Bind(TitleRecipe).To(res => res.name);
                set.Bind(SubtitleRecipe).To(res => res.description);
                set.Bind(ThumbnailPicture).For(img => img.Image).To(res => res.thumbnail).WithConversion <StringToImageConverter>();

                set.Apply();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #36
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			// Create the search controller, but we'll make sure that this AAPLSearchShowResultsInSourceViewController
			// performs the results updating.

			// TODO: parameter must be null https://trello.com/c/SibgrTuB
			_searchController = new UISearchController (new UIViewController());
			_searchController.SearchResultsUpdater = new UISearchResultsUpdatingWrapper (this);
			_searchController.DimsBackgroundDuringPresentation = false;

			// Make sure the that the search bar is visible within the navigation bar.
			_searchController.SearchBar.SizeToFit ();

			// Include the search controller's search bar within the table's header view.
			TableView.TableHeaderView = _searchController.SearchBar;

			DefinesPresentationContext = true;
		}
        public virtual void UpdateSearchResultsForSearchController(UISearchController searchController)
        {
            var tableController = (ResultsTableController)searchController.SearchResultsController;

            ShowLoadingView("Searching...");
            var searchTerm = searchController.SearchBar.Text.Trim();

            Task runSync = Task.Factory.StartNew(async(object inputObj) => {
                var sTerm = inputObj != null ? inputObj.ToString() : "";
                if (sTerm.Length > 2)
                {
                    var searchData = await PerformSearch(sTerm);
                    InvokeOnMainThread(() => {
                        tableController.FilteredPredictions = searchData;
                        tableController.TableView.ReloadData();
                    });
                }
                HideLoadingView();
            }, searchTerm).Unwrap();
        }
Exemple #38
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            if (SelectedBoxGroup != null)
            {
                loadList();
            }

            resultsTableController = new ResultsTableControllerBox
            {
                FilteredProducts = new List <BoxedItem>()
            };

            searchController = new UISearchController(resultsTableController)
            {
                WeakDelegate = this,
                DimsBackgroundDuringPresentation = false,
                WeakSearchResultsUpdater         = this
            };

            searchController.SearchBar.SizeToFit();
            TableView.TableHeaderView = searchController.SearchBar;

            resultsTableController.TableView.WeakDelegate = this;
            searchController.SearchBar.WeakDelegate       = this;

            DefinesPresentationContext = true;

            if (searchControllerWasActive)
            {
                searchController.Active   = searchControllerWasActive;
                searchControllerWasActive = false;

                if (searchControllerSearchFieldWasFirstResponder)
                {
                    searchController.SearchBar.BecomeFirstResponder();
                    searchControllerSearchFieldWasFirstResponder = false;
                }
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            LoadShips();              //This loads 480KB of JSON and processes 12,000 entries into an IList<IShipToken>

            SearchController = new UISearchController((UIViewController)null)
            {
                WeakDelegate = this,
                DimsBackgroundDuringPresentation = false,
                WeakSearchResultsUpdater         = this,
                //HidesNavigationBarDuringPresentation = false
                DefinesPresentationContext = false
            };

            DefinesPresentationContext = true;

            SearchController.SearchBar.SizeToFit();

            this.TableView.TableHeaderView = SearchController.SearchBar;
        }
        public void UpdateSearchResultsForSearchController(UISearchController searchController)
        {
            //search
            var find = searchController.SearchBar.Text;

            if (searchController.SearchBar.Text != "")
            {
                getList(find);
            }
            else
            {
                var         alertNumber = UIAlertController.Create("Error", "Ingresa el el parametro de busqueda", UIAlertControllerStyle.Alert);
                UITextField testo       = new UITextField();

                alertNumber.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, action => getList(testo.Text.ToString())));



                PresentViewController(alertNumber, animated: true, completionHandler: null);
            }
        }
Exemple #41
0
        public void setUpSearchView()
        {
            // add search
            var searchResultsController = new SearchViewController(mapView);

            var searchUpdater = new SearchResultsUpdator();

            searchUpdater.UpdateSearchResults += searchResultsController.UpdateSearchResults;

            // add the search controller
            searchController = new UISearchController(searchResultsController);
            searchController.SearchResultsUpdater = searchUpdater;

            searchController.SearchBar.SizeToFit();
            searchController.SearchBar.SearchBarStyle = UISearchBarStyle.Minimal;
            searchController.SearchBar.Placeholder    = "Enter a search query";

            searchController.HidesNavigationBarDuringPresentation = false;
            NavigationItem.TitleView   = searchController.SearchBar;
            DefinesPresentationContext = true;
        }
Exemple #42
0
        public void UpdateSearchResultsForSearchController(UISearchController searchController)
        {
            if (searchController.SearchBar.Text.Length == 0)
            {
                FilteredProducts.Clear();
            }
            else
            {
                FilteredProducts = new List <string> ();

                foreach (string product in Products)
                {
                    if (product.IndexOf(searchController.SearchBar.Text, StringComparison.OrdinalIgnoreCase) >= 0)
                    {
                        FilteredProducts.Add(product);
                    }
                }
            }

            TableView.ReloadData();
        }
Exemple #43
0
        public void UpdateSearchResultsForSearchController(UISearchController searchController)
        {
            var text = searchController.SearchBar.Text;

            if (searchController.Active)
            {
                var filteredList = _conferences.Where(
                    conf => CultureInfo.CurrentCulture.CompareInfo.IndexOf(conf.Name, text, CompareOptions.IgnoreCase) >= 0 ||
                    conf.Sessions.Any(session => CultureInfo.CurrentCulture.CompareInfo.IndexOf(session.Title, text, CompareOptions.IgnoreCase) >= 0 ||
                                      conf.Sessions.Any(session2 => session2.Speakers.Any(speaker => CultureInfo.CurrentCulture.CompareInfo.IndexOf(speaker.LastName, text, CompareOptions.IgnoreCase) >= 0))
                                      )
                    ).ToList();
                _filteredConferences = new ObservableCollection <Conference> (filteredList);
            }
            else
            {
                _filteredConferences = _conferences;
            }

            TableView.ReloadData();
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            UISearchController searchController = new UISearchController();

            //searchController.SearchBar.SizeToFit();
            this.TableView.TableHeaderView = searchController.SearchBar;

            //UISearchController searchController = new UISearchController()
            //{
            //	WeakDelegate = this,
            //	DimsBackgroundDuringPresentation = false,
            //	WeakSearchResultsUpdater = this
            //};


            //tblList.TableHeaderView = searchController.SearchBar;
            //searchController.SearchBar.SizeToFit();

            //searchController.SearchBar.WeakDelegate = this;
        }
Exemple #45
0
        public async void UpdateSearchResultsForSearchController(UISearchController searchController)
        {
            var searchString = searchController.SearchBar?.Text;

            try
            {
                ResultStrings = new List <NSAttributedString> ();

                if (!string.IsNullOrWhiteSpace(searchString))
                {
                    LocationResults = await WuAcClient.GetAsync(searchString);

                    foreach (var result in LocationResults)
                    {
                        ResultStrings.Add(result.name.GetSearchResultAttributedString(searchString));
                    }
                }
                else
                {
                    LocationResults = new List <WuAcLocation> ();
                }

                if (LocationResults.Any())
                {
                    emptyView.RemoveFromSuperview();
                }
                else if (!emptyView.IsDescendantOfView(ParentViewController.View))
                {
                    initEmptyView();
                }

                TableView?.ReloadData();

                MaskCells(TableView);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }
        }
Exemple #46
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
//			View.BackgroundColor = UIColor.White;
//			TableView = new UITableView (CGRect.Empty, UITableViewStyle.Plain);
//			TableView.TranslatesAutoresizingMaskIntoConstraints = false;
//			View.AddSubview (TableView);
//			View.AddConstraints (NSLayoutConstraint.FromVisualFormat ("V:|-[tableview]-|",(NSLayoutFormatOptions)0,"tableview",TableView));
//			View.AddConstraints (NSLayoutConstraint.FromVisualFormat ("H:|-[tableview]-|",(NSLayoutFormatOptions)0,"tableview",TableView));


			SearchController = new UISearchController (searchResultsController: null);
			SearchController.Delegate = new SearchControllerDelegate ();
			SearchController.HidesNavigationBarDuringPresentation = false;
			SearchController.SearchBar.SearchBarStyle = UISearchBarStyle.Minimal;
			SearchController.SearchBar.Placeholder = "To";
			NavigationItem.TitleView = SearchController.SearchBar;
			DefinesPresentationContext = true;
			SearchController.DimsBackgroundDuringPresentation = false;
			SearchController.DefinesPresentationContext = true;
			SearchController.SearchBar.BecomeFirstResponder ();
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			// Create the search results view controller and use it for the UISearchController.
			var searchResultsController = (SearchResultsViewController)Storyboard.InstantiateViewController (SearchResultsViewController.StoryboardIdentifier);

			// Create the search controller and make it perform the results updating.
			searchController = new UISearchController (searchResultsController);
			searchController.SetSearchResultsUpdater (searchResultsController.UpdateSearchResultsForSearchController);
			searchController.HidesNavigationBarDuringPresentation = false;

			// Configure the search controller's search bar. For more information on how to configure
			// search bars, see the "Search Bar" group under "Search".
			searchController.SearchBar.SearchBarStyle = UISearchBarStyle.Minimal;
			searchController.SearchBar.Placeholder = "Search";

			// Include the search bar within the navigation bar.
			NavigationItem.TitleView = searchController.SearchBar;

			DefinesPresentationContext = true;
		}
		public virtual void UpdateSearchResultsForSearchController (UISearchController searchController)
		{
			var tableController = (ResultsTableController)searchController.SearchResultsController;
			tableController.FilteredProducts = PerformSearch (searchController.SearchBar.Text);
			tableController.TableView.ReloadData ();
		}
 /// <summary>
 /// Updates the search results for search controller.
 /// </summary>
 /// <param name="searchController">Search controller.</param>
 public void UpdateSearchResultsForSearchController(UISearchController searchController)
 {
     // Save the search filter and update the Collection View
     SearchFilter = searchController.SearchBar.Text ?? string.Empty;
 }
		public void UpdateSearchResultsForSearchController (UISearchController searchController)
		{
			var text = searchController.SearchBar.Text;
			if (searchController.Active) {
				var filteredList = _conferences.Where (p => 
					CultureInfo.CurrentCulture.CompareInfo.IndexOf
					(p.Name, text, CompareOptions.IgnoreCase) >= 0).ToList ();
				_filteredConferences = new ObservableCollection<Conference> (filteredList);
			} else {
				_filteredConferences = _conferences;
			}

			TableView.ReloadData ();
		}
		public void UpdateSearchResultsForSearchController (UISearchController searchController)
		{
			var text = searchController.SearchBar.Text;
			if (searchController.Active) {
				var filteredList = _conferences.Where (
					                   conf => CultureInfo.CurrentCulture.CompareInfo.IndexOf (conf.Name, text, CompareOptions.IgnoreCase) >= 0
					                   || conf.Sessions.Any (session => CultureInfo.CurrentCulture.CompareInfo.IndexOf (session.Title, text, CompareOptions.IgnoreCase) >= 0
					                   || conf.Sessions.Any (session2 => session2.Speakers.Any (speaker => CultureInfo.CurrentCulture.CompareInfo.IndexOf (speaker.LastName, text, CompareOptions.IgnoreCase) >= 0)) 
					                   )
				                   ).ToList ();
				_filteredConferences = new ObservableCollection<Conference> (filteredList);
			} else {
				_filteredConferences = _conferences;
			}

			TableView.ReloadData ();
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			_conferences = Vm.Conferences;
			_filteredConferences = _conferences;

			_uirc = new UIRefreshControl ();
			_uirc.ValueChanged += async (sender, e) => { 
				await LoadConferences (Priority.UserInitiated);
				_uirc.EndRefreshing ();
			};

			RefreshControl = _uirc;

			//AddEmptyView ();
				
			Messenger.Default.Register<AuthenticationInitializedMessage>
            (
				this,
				async (message) => { 
					_uirc.BeginRefreshing ();
					await LoadConferences (Priority.UserInitiated);
					_uirc.EndRefreshing ();
				}
			);

			Messenger.Default.Register<ConferenceAddedMessage>
			(
				this,
				async (message) => { 
					TableView.SetContentOffset (new CoreGraphics.CGPoint (x: 0, y: 0 - _uirc.Frame.Size.Height - _searchController.SearchBar.Frame.Size.Height), animated: true);
					_uirc.BeginRefreshing ();
					await LoadConferences (Priority.UserInitiated);
					_uirc.EndRefreshing ();
					TableView.SetContentOffset (new CoreGraphics.CGPoint (x: 0, y: -((_searchController.SearchBar.Frame.Size.Height - 10) * 2)), animated: true);

				}
			);

			_searchController = new UISearchController ((UITableViewController)null) {
				DimsBackgroundDuringPresentation = false
			};
			this.TableView.TableHeaderView = _searchController.SearchBar;
			_searchController.SearchBar.SizeToFit ();
			DefinesPresentationContext = true;
			_searchController.SearchResultsUpdater = this;
			this.TableView.SetContentOffset (new CGPoint (0, _searchController.SearchBar.Frame.Size.Height), animated: false);
			_searchController.SearchBar.BarTintColor = UIColor.FromRGB (red: 128, green: 153, blue: 77);

		}
		public override void UpdateSearchResultsForSearchController (UISearchController searchController)
		{
			// Inform caller of the update event
			RaiseUpdateSearchResults (searchController.SearchBar.Text);
		}
Exemple #54
0
			public override void WillPresentSearchController (UISearchController searchController)
			{
				var g  = searchController.SearchBar.CanBecomeFirstResponder;
				int h = 0;
			}
		public async void UpdateSearchResultsForSearchController (UISearchController searchController) {
			var tableController = this.search.SearchResultsController as SearchResultsTableViewController;
			tableController.Configuration = this.configuration;
			var result = await Data.Current.SearchAsync (searchController.SearchBar.Text);
			tableController.Reload (result);

		}
		/// <summary>
		/// Отображение SearchViewController с таблицей
		/// </summary>
		/// <param name="context">Context.</param>
		/// <param name="senderVc">Sender vc.</param>
		/// <param name="searchStations">Search stations.</param>
		void ShowSearchSearchView (string context, UIViewController senderVc, IList<SectionStation> searchStations){
			var tableTest = new CitiesScheduleView (showAll,context,searchStations);
			tableTest.TableView.KeyboardDismissMode = UIScrollViewKeyboardDismissMode.OnDrag;
			var searchController = new UISearchController (tableTest);
			searchController.DimsBackgroundDuringPresentation = true;
			searchController.ObscuresBackgroundDuringPresentation = true;
			searchController.DefinesPresentationContext = false;
			senderVc.DefinesPresentationContext = true;
			searchController.SearchResultsUpdater = tableTest;
			senderVc.PresentViewController (searchController, true, null);
		}
Exemple #57
0
			public override void DidPresentSearchController (UISearchController searchController)
			{
				var g  = searchController.SearchBar.CanBecomeFirstResponder;
				searchController.BecomeFirstResponder ();
				searchController.SearchBar.BecomeFirstResponder ();
			}
 public void UpdateSearchResultsForSearchController(UISearchController searchController)
 {
     FilterString = searchController.SearchBar.Text ?? string.Empty;
 }
 public override void UpdateSearchResultsForSearchController(UISearchController searchController)
 {
     this.UpdateSearchResults(searchController.SearchBar.Text);
 }