예제 #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;
        }
예제 #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;
        }
예제 #3
0
        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
        }
예제 #4
0
        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;
        }