Example #1
0
        public DayCommentPage()
        {
            InitializeComponent();
            BindingContext = App.Container.Resolve <DayCommentViewModel>(new TypedParameter(typeof(INavigation), Navigation));

            if (Device.RuntimePlatform == Device.iOS)
            {
                ExtendedToolbarItem saveToolbarItem = new ExtendedToolbarItem()
                {
                    Done = true, Text = AppResources.SaveText
                };
                saveToolbarItem.SetBinding(ExtendedToolbarItem.CommandProperty, "SaveCommand");
                ToolbarItems.Add(saveToolbarItem);
            }

            ExtendedToolbarItem cancelToolbarItem = new ExtendedToolbarItem()
            {
                Left = true, Text = AppResources.CancelText
            };

            cancelToolbarItem.SetBinding(ExtendedToolbarItem.CommandProperty, "CancelCommand");
            ToolbarItems.Add(cancelToolbarItem);

            ViewModel.PhoneItems.CollectionChanged  += Items_CollectionChanged;
            ViewModel.TravelItems.CollectionChanged += Items_CollectionChanged;
        }
Example #2
0
        public CustomTransportSelectionPage(SelectableObservableCollection <Model.TransportModeItem> items)
        {
            if (Device.RuntimePlatform == Device.iOS)
            {
                ExtendedToolbarItem saveToolbarItem = new ExtendedToolbarItem()
                {
                    Done = true, Text = AppResources.SaveText
                };
                saveToolbarItem.SetBinding(ExtendedToolbarItem.CommandProperty, "SaveCommand");
                ToolbarItems.Add(saveToolbarItem);
            }

            ExtendedToolbarItem cancelToolbarItem = new ExtendedToolbarItem()
            {
                Left = true, Text = AppResources.CancelText
            };

            cancelToolbarItem.SetBinding(ExtendedToolbarItem.CommandProperty, "CancelCommand");
            ToolbarItems.Add(cancelToolbarItem);

            InitializeComponent();

            BindingContext = App.Container.Resolve <CustomTransportSelectionViewModel>(
                new TypedParameter(typeof(INavigation), Navigation),
                new NamedParameter("activeItems", items));
        }
Example #3
0
        public TransportSelectionPage(TrackEntry trackEntry)
        {
            InitializeComponent();
            BindingContext = App.Container.Resolve <TransportSelectionViewModel>(
                new TypedParameter(typeof(INavigation), Navigation),
                new TypedParameter(typeof(TrackEntry), trackEntry));

            if (Xamarin.Forms.Device.RuntimePlatform == Xamarin.Forms.Device.iOS)
            {
                ExtendedToolbarItem saveToolbarItem = new ExtendedToolbarItem()
                {
                    Done = true, Text = AppResources.SaveText
                };
                saveToolbarItem.SetBinding(ExtendedToolbarItem.CommandProperty, "SaveCommand");
                ToolbarItems.Add(saveToolbarItem);
            }

            ExtendedToolbarItem cancelToolbarItem = new ExtendedToolbarItem()
            {
                Left = true, Text = AppResources.CancelText
            };

            cancelToolbarItem.SetBinding(ExtendedToolbarItem.CommandProperty, "CancelCommand");
            ToolbarItems.Add(cancelToolbarItem);

            AdjustListViewHeight();

            ViewModel.Items.CollectionChanged += (object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) =>
            {
                AdjustListViewHeight();
            };
        }
        public StopDetailNamePage(StopVisitViewModel stopVisitViewModel)
        {
            InitializeComponent();

            if (Device.RuntimePlatform == Device.iOS)
            {
                ExtendedToolbarItem saveToolbarItem = new ExtendedToolbarItem()
                {
                    Done = true, Text = AppResources.SaveText
                };
                saveToolbarItem.SetBinding(ExtendedToolbarItem.CommandProperty, "SaveCommand");
                ToolbarItems.Add(saveToolbarItem);
            }

            ExtendedToolbarItem cancelToolbarItem = new ExtendedToolbarItem()
            {
                Left = true, Text = AppResources.CancelText
            };

            cancelToolbarItem.SetBinding(ExtendedToolbarItem.CommandProperty, "CancelCommand");
            ToolbarItems.Add(cancelToolbarItem);


            BindingContext = App.Container.Resolve <StopDetailNameViewModel>(new TypedParameter(typeof(INavigation), Navigation),
                                                                             new TypedParameter(typeof(StopVisitViewModel), stopVisitViewModel));

            AdjustPossibleStopsListHeight();
        }
Example #5
0
        public void BindToolbar()
        {
            List <ToolbarItem> lstToolbarItem = new List <ToolbarItem>();

            ExtendedToolbarItem menuToolbarItem = new ExtendedToolbarItem("Menu", Constant.ImagePath.SlideOutMenu, ToolbarItemOrder.Primary, LeftMenu);

            lstToolbarItem.Add(menuToolbarItem);

            foreach (ToolbarItem item in lstToolbarItem)
            {
                this.ToolbarItems.Add(item);
            }
        }
Example #6
0
        public void BindToolbar()
        {
            List <ToolbarItem> lstToolbarItem = new List <ToolbarItem>();

            ExtendedToolbarItem homeToolbarItem = new ExtendedToolbarItem("Home", Constants.ImagePath.ToolbarHomeIcon(), ToolbarItemOrder.Primary, LogoClick);
            ExtendedToolbarItem menuToolbarItem = new ExtendedToolbarItem("Menu", Constants.ImagePath.LeftMenuIcon, ToolbarItemOrder.Primary, CategoryMenu);

            lstToolbarItem.Add(homeToolbarItem);
            lstToolbarItem.Add(menuToolbarItem);

            foreach (ToolbarItem item in lstToolbarItem)
            {
                this.ToolbarItems.Add(item);
            }
        }
        public StopDetailMotivePage(StopMotiveViewModel motiveViewModel)
        {
            InitializeComponent();

            ExtendedToolbarItem cancelToolbarItem = new ExtendedToolbarItem()
            {
                Left = true, Text = AppResources.CancelText
            };

            cancelToolbarItem.SetBinding(ExtendedToolbarItem.CommandProperty, "CancelCommand");
            ToolbarItems.Add(cancelToolbarItem);

            BindingContext = App.Container.Resolve <StopDetailMotiveViewModel>(new TypedParameter(typeof(StopMotiveViewModel), motiveViewModel), new TypedParameter(typeof(INavigation), Navigation));

            ViewModel.PossibleMotives.CollectionChanged += (object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) =>
            {
                AdjustListViewHeight();
            };
        }