Beispiel #1
0
        public MainPage()
        {
            this.InitializeComponent();

            this.Malls = new ObservableView <Mall>(MallManager.GetMalls());
            this.Malls.SearchSpecification.Add(mall => mall.Title);
            this.Malls.SearchSpecification.Add(mall => mall.Subtitle);

            this.BindingContext = this;
        }
Beispiel #2
0
        public MainPage()
        {
            this.InitializeComponent();

            var listItems = MallManager.GetMalls();

            this.ListItemsView = new ObservableView <Mall>(listItems);
            this.ListItemsView.AddSearchSpecification(x => x.Title);
            this.ListItemsView.AddSearchSpecification(x => x.Subtitle);

            this.searchBox.Focus(FocusState.Keyboard);
            this.searchBox.TextChanged += this.OnSearchBoxTextChanged; // You could use SearchText data binding in XAML instead

            this.DataContext = this;
        }
        public ViewController(IntPtr handle)
            : base(handle)
        {
            this.Title = "Malls";

            var malls = MallManager.GetMalls();

            this.ListController            = new ObservableViewTableViewController <Mall>();
            this.ListController.DataSource = new ObservableView <Mall>(malls);
            this.ListController.DataSource.AddSearchSpecification(x => x.Title);
            this.ListController.DataSource.AddSearchSpecification(x => x.Subtitle);
            this.ListController.CreateCellDelegate = this.CreateCell;
            this.ListController.BindCellDelegate   = this.BindCell;

            this.ListController.TableView = this.ListController.TableView; // BUG: TableView is not created
        }
        public MainWindow()
        {
            this.InitializeComponent();

            var listItems = MallManager.GetMalls();

            this.ListItemsView = new ObservableView <Mall>(listItems);
            this.ListItemsView.AddSearchSpecification(x => x.Title);
            this.ListItemsView.AddSearchSpecification(x => x.Subtitle);

            this.searchBox.Focus();


            // In this example we use the binding Text = "{Binding ListItemsView.SearchText, Mode=TwoWay}"
            // in order to bind the searchBox.Text to the SearchText property of the ObservableView< Mall >.
            // Therefore, the following OnSearchBoxTextChanged event handler can be removed:

            // this.searchBox.TextChanged += this.OnSearchBoxTextChanged;


            this.DataContext = this;
        }