Пример #1
0
        private StackLayout BuildContent()
        {
            var layout = new StackLayout ();

            _list = new ListView {
                //VerticalOptions = LayoutOptions.FillAndExpand,
                ItemTemplate = new DataTemplate(typeof(ListItemView)),
                RowHeight = 90,
            };

            _list.ItemTapped +=	(sender, e) => {
                var todoListPage = new TodoListPage ();
                Navigation.PushAsync (todoListPage);
            };

            _list.ItemSelected += (sender, e) => {
                var todoListPage = new TodoListPage ();
                Navigation.PushAsync (todoListPage);
            };

            _list.SetBinding(ListView.ItemsSourceProperty, "Data");

            layout.Children.Add (_list);
            layout.VerticalOptions = LayoutOptions.FillAndExpand;
            layout.BackgroundColor = Color.Yellow;

            return layout;
        }
Пример #2
0
        private StackLayout BuildContent()
        {
            var layout = new StackLayout();

            var setMeasurePointButton = new Button { Text = "2. Set Measure Point" };
            setMeasurePointButton.Clicked += (sender, e) =>
                {
                    var todoListPage = new TodoListPage(new SharedBeacon(), BeaconType.MeasurePoint);
                    Navigation.PushAsync(todoListPage);
                };

            var startButton = new Button { Text = "3. Start" };
            startButton.Clicked += (sender, e) =>
                {
                    var todoListPage = new TodoListPage(new SharedBeacon(), BeaconType.StartProcess);
                    Navigation.PushAsync(todoListPage);
                };

            var deleteAllButton = new Button { Text = "4. Delete Points" };
            deleteAllButton.Clicked += (sender, e) =>
                {
                   ProxyServiceAgent.DeleteAllData();
                };

            this.listView = new ListView { ItemTemplate = new DataTemplate(typeof(ListItemView)), RowHeight = 90, };
            this.listView.ItemSelected += (sender, e) =>
                {
                    var sharedBeaconItem = (SharedBeacon)e.SelectedItem;
                    var todoListPage = new TodoListPage(sharedBeaconItem, BeaconType.AccessPoint);
                    Navigation.PushAsync(todoListPage);
                };

            this.listView.SetBinding(ListView.ItemsSourceProperty, "Data");

            layout.Children.Add(setMeasurePointButton);
            layout.Children.Add(startButton);
            layout.Children.Add(deleteAllButton);
            layout.Children.Add(this.listView);
            layout.VerticalOptions = LayoutOptions.FillAndExpand;
            layout.BackgroundColor = Color.Yellow;

            return layout;
        }