public LanesPage(string pageTitle)
        {
            BindingContext = new LanesViewModel();

            Title = $"Lanes {pageTitle}";

            IconImageSource = "Road_navigation";

            Content = new RefreshView
            {
                Content = new CollectionView
                {
                    ItemTemplate  = new LanesDataTemplate(),
                    SelectionMode = SelectionMode.Single,
                }.Assign(out CollectionView collectionView)
                .Bind(CollectionView.ItemsSourceProperty, nameof(LanesViewModel.LanesCollection))
            }.Bind(RefreshView.CommandProperty, nameof(LanesViewModel.RefreshCommand))
Esempio n. 2
0
        public LanesPage(string pageTitle)
        {
            _viewModel     = new LanesViewModel();
            BindingContext = _viewModel;

            _listView = new ListView
            {
                RowHeight    = 200,
                ItemTemplate = new DataTemplate(typeof(LanesViewCell))
            };
            _listView.IsPullToRefreshEnabled = true;
            _listView.SetBinding(ListView.ItemsSourceProperty, nameof(_viewModel.LanesList));

            Title = $"Lanes {pageTitle}";

            NavigationPage.SetTitleIcon(this, "Road_navigation");

            Content = _listView;
        }
Esempio n. 3
0
        public LanesPage(string pageTitle)
        {
            //Instantiate the viewmodel for the Lanes Page
            viewModel      = new LanesViewModel();
            BindingContext = viewModel;

            //Create the ListView for the Lanes Page
            listView = new ListView
            {
                RowHeight    = 200,
                ItemTemplate = new DataTemplate(typeof(LanesViewCell))
            };
            listView.ItemTapped += OnListViewItemTapped;

            Title = $"Lanes {pageTitle}";

            NavigationPage.SetTitleIcon(this, "Road_navigation");

            Content = listView;
        }
        public LanesPage(string pageTitle)
        {
            //Instantiate the viewmodel for the Lanes Page
            viewModel      = new LanesViewModel();
            BindingContext = viewModel;

            //Create the ListView for the Lanes Page
            listView = new ListView
            {
                RowHeight    = 200,
                ItemTemplate = new DataTemplate(typeof(LanesViewCell))
            };
            listView.IsPullToRefreshEnabled = true;
            listView.SetBinding(ListView.ItemsSourceProperty, "LanesList");

            Title = $"Lanes {pageTitle}";

            NavigationPage.SetTitleIcon(this, "Road_navigation");

            Content = listView;
        }
        public SettingsPage(LanesViewModel viewModel)
        {
            BindingContext = viewModel;

            #region create the IsOpen Switch
            var isOpenSwitch = new SwitchCell
            {
                Text = "Is Open"
            };
            isOpenSwitch.SetBinding(SwitchCell.OnProperty, "LaneTappedIsOpen");
            #endregion

            #region Create the Needs Maintenance Switch
            var needsMaintenanceSwitch = new SwitchCell
            {
                Text = "Needs Maintenance"
            };
            needsMaintenanceSwitch.SetBinding(SwitchCell.OnProperty, "LaneTappedNeedsMaintenance");
            #endregion

            #region create the IP Address Entry
            var ipAddressText = new EntryCell
            {
                Label = "IP Address",
                HorizontalTextAlignment = TextAlignment.End
            };
            ipAddressText.SetBinding(EntryCell.TextProperty, "LaneTappedIPAddress");
            #endregion

            #region Create Image Cell
            var imageCell = new ImageCell();
            imageCell.SetBinding(ImageCell.ImageSourceProperty, "ImageCellIcon");
            #endregion

            #region Create the Icon Toggle Button
            var iconToggleButton = new Button();
            iconToggleButton.SetBinding(Button.CommandProperty, "IconToggleButton");
            iconToggleButton.SetBinding(Button.TextProperty, "ToggleButtonText");
            #endregion

            #region create the TableView
            var tableView = new TableView
            {
                Intent = TableIntent.Settings,
                Root   = new TableRoot
                {
                    new TableSection {
                        isOpenSwitch,
                        needsMaintenanceSwitch,
                        ipAddressText,
                        imageCell
                    }
                }
            };
            #endregion

            #region Create StackLayout to Include a Button
            var settingsStack = new StackLayout
            {
                Children =
                {
                    tableView,
                    iconToggleButton
                }
            };
            #endregion

            NavigationPage.SetTitleIcon(this, "cogwheel_navigation");

            Title   = $"Lane {viewModel.LanesList.IndexOf(viewModel.LaneTapped)+1} Settings";
            Content = settingsStack;
        }