示例#1
0
        public Filtering()
        {
            viewmodel = new FilterViewModel();

            this.SfGrid = new SfDataGrid();
            this.SfGrid.SelectionMode         = SelectionMode.Single;
            this.SfGrid.AutoGeneratingColumn += GridAutoGenerateColumns;
            this.SfGrid.ItemsSource           = viewmodel.BookInfo;
            this.SfGrid.HeaderRowHeight       = 45;
            this.SfGrid.RowHeight             = 45;
            if (Utility.IsIpad)
            {
                this.SfGrid.ColumnSizer = ColumnSizer.Star;
            }
            this.SfGrid.GridStyle.AlternatingRowColor = UIColor.FromRGB(219, 219, 219);
            searchbar = new UISearchBar();
            searchbar.OnEditingStarted    += HandleOnEditingStarted;
            searchbar.TextChanged         += HandleTextChanged;
            searchbar.CancelButtonClicked += HandleCancelButtonClicked;
            if (UIDevice.CurrentDevice.CheckSystemVersion(7, 1))
            {
                searchbar.EnablesReturnKeyAutomatically = false;
            }
            searchbar.Placeholder       = "Search in All Columns";
            viewmodel.filtertextchanged = OnFilterChanged;
            option          = new OptionsView(viewmodel, searchbar, this);
            this.OptionView = option;
            this.AddSubview(searchbar);
            this.AddSubview(SfGrid);
        }
		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);
		}
示例#3
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);
 }
        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);
        }