Ejemplo n.º 1
0
        public OptionsView(FilterViewModel model, UISearchBar bar, Filtering parentView) : this()
        {
            this.ParentView  = parentView;
            this.filtermodel = model;
            var columnnames = filtermodel.BookInfo.GetType().GetGenericArguments() [0].GetProperties();

            this.bar = bar;
            foreach (var propety in columnnames)
            {
                items.Add(propety.Name);
            }
            table.Source = new OptionsTableSource(items);
            filterconditiontable.Source = new FilterOptionsTableSource(new List <string> ()
            {
                "Contains",
                "Equals",
                "Not Equals"
            });
            this.AddSubview(filterconditiontable);
            this.AddSubview(table);
        }
Ejemplo n.º 2
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (searchbar != null)
         {
             searchbar.OnEditingStarted    -= HandleOnEditingStarted;
             searchbar.TextChanged         -= HandleTextChanged;
             searchbar.CancelButtonClicked -= HandleCancelButtonClicked;
         }
         if (SfGrid != null)
         {
             SfGrid.AutoGeneratingColumn -= GridAutoGenerateColumns;
             SfGrid.Dispose();
         }
         searchbar = null;
         option    = null;
         viewmodel = null;
         SfGrid    = null;
     }
     base.Dispose(disposing);
 }
Ejemplo n.º 3
0
		public Filtering()
		{
			viewmodel = new FilterViewModel ();

			this.SfGrid = new SfDataGrid ();
			this.SfGrid.AutoGeneratingColumn += GridAutoGenerateColumns;	
			this.SfGrid.ItemsSource = viewmodel.BookInfo;
			this.SfGrid.HeaderRowHeight = 45;
			this.SfGrid.RowHeight = 45;
			this.SfGrid.AlternatingRowColor = UIColor.FromRGB (219, 219, 219);
			searchbar = new UISearchBar ();
			searchbar.OnEditingStarted += HandleOnEditingStarted;
			searchbar.TextChanged += HandleTextChanged;
			searchbar.CancelButtonClicked += HandleCancelButtonClicked;
			searchbar.EnablesReturnKeyAutomatically = false;
			searchbar.Placeholder = "Search in All Columns";
			viewmodel.filtertextchanged = OnFilterChanged;
			option = new OptionsView (viewmodel,searchbar,this);
			this.control = this;
			this.AddSubview (searchbar);
			this.AddSubview (SfGrid);
		}
Ejemplo n.º 4
0
        public Filtering()
        {
            viewmodel = new FilterViewModel();

            this.SfGrid = new SfDataGrid();
            this.SfGrid.AutoGeneratingColumn += GridAutoGenerateColumns;
            this.SfGrid.ItemsSource           = viewmodel.BookInfo;
            this.SfGrid.HeaderRowHeight       = 45;
            this.SfGrid.RowHeight             = 45;
            this.SfGrid.AlternatingRowColor   = UIColor.FromRGB(219, 219, 219);
            searchbar = new UISearchBar();
            searchbar.OnEditingStarted             += HandleOnEditingStarted;
            searchbar.TextChanged                  += HandleTextChanged;
            searchbar.CancelButtonClicked          += HandleCancelButtonClicked;
            searchbar.EnablesReturnKeyAutomatically = false;
            searchbar.Placeholder                   = "Search in All Columns";
            viewmodel.filtertextchanged             = OnFilterChanged;
            option       = new OptionsView(viewmodel, searchbar, this);
            this.control = this;
            this.AddSubview(searchbar);
            this.AddSubview(SfGrid);
        }
Ejemplo n.º 5
0
		public OptionsView (FilterViewModel model, UISearchBar bar , Filtering parentView) : this ()
		{
			this.ParentView = parentView;
			this.filtermodel = model;
			var columnnames = filtermodel.BookInfo.GetType ().GetGenericArguments () [0].GetProperties ();
			this.bar = bar;
			foreach (var propety in columnnames) {
				items.Add (propety.Name);
			}
			table.Source = new OptionsTableSource (items);
			filterconditiontable.Source = new FilterOptionsTableSource (new List<string> () {
				"Contains",
				"Equals",
				"Not Equals"
			});
			this.AddSubview (filterconditiontable);
			this.AddSubview (table);

		}