示例#1
0
        public ResortsPage()
        {
            InitializeComponent();

            BindingContext = new ResortsViewModel()
            {
                Resorts = Mapper.Map <ObservableCollection <ResortViewModel> >(ResortsService.GetAll())
            };

            var tapGestureRecognizer = new TapGestureRecognizer();

            tapGestureRecognizer.Tapped += OnResortsFilterPage;
            FilterFrame.GestureRecognizers.Add(tapGestureRecognizer);
        }
示例#2
0
        protected override void OnAppearing()
        {
            var context = (ResortsViewModel)BindingContext;
            var filter  = ResortsService.GetFilter();

            context.Resorts = Mapper.Map <ObservableCollection <ResortViewModel> >(filter != null ? ResortsService.ApplyFilter() : ResortsService.GetAll());
        }