public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            PackageListener = new PackageListener();

            PackageListener.OnPackageCancel       += UpdatePackage;
            PackageListener.OnPackageUpdate       += UpdatePackage;
            PackageListener.OnPackageStatusChange += UpdatePackage;
            PackageListener.OnPackageFail         += UpdatePackage;

            // Just get the complete list of names from map package listener
            PackageListener.OnPackageListUpdate += UpdateRoutingPackages;

            Manager.PackageManagerListener = PackageListener;
            Manager.Start();

            // Fetch list of available packages from server.
            // Note that this is asynchronous operation
            // and listener will be notified via onPackageListUpdated when this succeeds.
            Manager.StartPackageListDownload();

            Menu.List.AddRows(Manager.GetPackages());
            Menu.BackgroundClick += OnMenuBackgroundClicked;
            MenuButton.Click     += OnMenuButtonClick;
        }
Exemplo n.º 2
0
        protected override void OnResume()
        {
            base.OnResume();

            RoutingPackageListener = new PackageListener();
            RoutingPackageManager.PackageManagerListener = RoutingPackageListener;

            RoutingPackageListener.OnPackageCancel       += UpdatePackage;
            RoutingPackageListener.OnPackageUpdate       += UpdatePackage;
            RoutingPackageListener.OnPackageStatusChange += UpdatePackage;
            RoutingPackageListener.OnPackageFail         += UpdatePackage;

            MapPackageListener = new PackageListener();
            MapPackageManager.PackageManagerListener = MapPackageListener;

            // Just get the complete list of names from map package listener
            RoutingPackageListener.OnPackageListUpdate += UpdateRoutingPackages;
            RoutingPackageManager.Start();

            MapPackageListener.OnPackageListUpdate += UpdateMapPackages;
            MapPackageManager.Start();
            // Start downloading map packages instantly after view has loaded
            MapPackageManager.StartPackageListDownload();

            ContentView.Button.Click += OnMenuButtonClicked;
        }
        protected override void OnPause()
        {
            ContentView.Button.Click -= OnMenuButtonClicked;
            ContentView.Menu.CityTapped -= OnMenuSelectionChanged;

            // Always detach handlers OnPause to avoid memory leaks and objects with multple handlers
            packageListener.OnPackageCancel -= UpdatePackage;
            packageListener.OnPackageUpdate -= UpdatePackage;
            packageListener.OnPackageStatusChange -= UpdatePackage;
            packageListener.OnPackageFail -= UpdatePackage;

            manager.Stop(true);
            packageListener = null;

            base.OnPause();
        }
        protected override void OnPause()
        {
            ContentView.Button.Click    -= OnMenuButtonClicked;
            ContentView.Menu.CityTapped -= OnMenuSelectionChanged;

            // Always detach handlers OnPause to avoid memory leaks and objects with multple handlers
            packageListener.OnPackageCancel       -= UpdatePackage;
            packageListener.OnPackageUpdate       -= UpdatePackage;
            packageListener.OnPackageStatusChange -= UpdatePackage;
            packageListener.OnPackageFail         -= UpdatePackage;

            manager.Stop(true);
            packageListener = null;

            base.OnPause();
        }
        protected override void OnPause()
        {
            base.OnPause();

            // Always detach handlers OnPause to avoid memory leaks and objects with multple handlers
            packageListener.OnPackageListUpdate -= UpdatePackages;
            packageListener.OnPackageListFail   -= UpdatePackages;

            packageListener.OnPackageCancel       -= UpdatePackage;
            packageListener.OnPackageUpdate       -= UpdatePackage;
            packageListener.OnPackageStatusChange -= UpdatePackage;
            packageListener.OnPackageFail         -= UpdatePackage;

            packageManager.Stop(true);
            packageListener = null;
        }
        protected override void OnResume()
        {
            base.OnResume();

            ContentView.Button.Click += OnMenuButtonClicked;
            ContentView.Menu.CityTapped += OnMenuSelectionChanged;

            packageListener = new PackageListener();
            manager.PackageManagerListener = packageListener;

            // Always Attach handlers OnResume to avoid memory leaks and objects with multple handlers
            packageListener.OnPackageCancel += UpdatePackage;
            packageListener.OnPackageUpdate += UpdatePackage;
            packageListener.OnPackageStatusChange += UpdatePackage;
            packageListener.OnPackageFail += UpdatePackage;

            manager.Start();
        }
        protected override void OnResume()
        {
            base.OnResume();

            ContentView.Button.Click    += OnMenuButtonClicked;
            ContentView.Menu.CityTapped += OnMenuSelectionChanged;

            packageListener = new PackageListener();
            manager.PackageManagerListener = packageListener;

            // Always Attach handlers OnResume to avoid memory leaks and objects with multple handlers
            packageListener.OnPackageCancel       += UpdatePackage;
            packageListener.OnPackageUpdate       += UpdatePackage;
            packageListener.OnPackageStatusChange += UpdatePackage;
            packageListener.OnPackageFail         += UpdatePackage;

            manager.Start();
        }
        protected override void OnResume()
        {
            base.OnResume();

            packageListener = new PackageListener();
            packageManager.PackageManagerListener = packageListener;

            // Always Attach handlers OnResume to avoid memory leaks and objects with multple handlers
            packageListener.OnPackageListUpdate += UpdatePackages;
            packageListener.OnPackageListFail   += UpdatePackages;

            packageListener.OnPackageCancel       += UpdatePackage;
            packageListener.OnPackageUpdate       += UpdatePackage;
            packageListener.OnPackageStatusChange += UpdatePackage;
            packageListener.OnPackageFail         += UpdatePackage;

            packageManager.StartPackageListDownload();
            packageManager.Start();
        }
Exemplo n.º 9
0
        public override void ViewWillDisappear(bool animated)
        {
            base.ViewWillDisappear(animated);

            // Always detach handlers ViewWillDisappear to avoid memory leaks and objects with multple handlers

            MenuButton.Click -= OnMenuButtonClick;
            Menu.CityTapped  -= OnMenuSelectionChanged;

            packageListener = new PackageListener();
            packageManager.PackageManagerListener = packageListener;

            packageListener.OnPackageCancel       -= UpdatePackage;
            packageListener.OnPackageUpdate       -= UpdatePackage;
            packageListener.OnPackageStatusChange -= UpdatePackage;
            packageListener.OnPackageFail         -= UpdatePackage;

            packageManager.Stop(true);
        }
        public override void ViewWillDisappear(bool animated)
        {
            base.ViewWillDisappear(animated);

            // Always detach handlers ViewWillDisappear to avoid memory leaks and objects with multple handlers
            packageListener.OnPackageListUpdate -= UpdatePackages;
            packageListener.OnPackageListFail   -= UpdatePackages;

            packageListener.OnPackageCancel       -= UpdatePackage;
            packageListener.OnPackageUpdate       -= UpdatePackage;
            packageListener.OnPackageStatusChange -= UpdatePackage;
            packageListener.OnPackageFail         -= UpdatePackage;

            ContentView.ListSource.CellActionButtonClicked -= OnCellActionButtonClick;

            packageManager.Stop(true);
            packageListener = null;

            MenuButton.Click -= OnMenuButtonClick;
        }
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            packageListener = new PackageListener();
            packageManager.PackageManagerListener = packageListener;

            // Always Attach handlers ViewWillAppear to avoid memory leaks and objects with multple handlers
            packageListener.OnPackageListUpdate += UpdatePackages;
            packageListener.OnPackageListFail   += UpdatePackages;

            packageListener.OnPackageCancel       += UpdatePackage;
            packageListener.OnPackageUpdate       += UpdatePackage;
            packageListener.OnPackageStatusChange += UpdatePackage;
            packageListener.OnPackageFail         += UpdatePackage;

            ContentView.ListSource.CellActionButtonClicked += OnCellActionButtonClick;

            packageManager.StartPackageListDownload();

            packageManager.Start();

            MenuButton.Click += OnMenuButtonClick;
        }
        protected override void OnResume()
        {
            base.OnResume();

            RoutingPackageListener = new PackageListener();
            RoutingPackageManager.PackageManagerListener = RoutingPackageListener;

            RoutingPackageListener.OnPackageCancel += UpdatePackage;
            RoutingPackageListener.OnPackageUpdate += UpdatePackage;
            RoutingPackageListener.OnPackageStatusChange += UpdatePackage;
            RoutingPackageListener.OnPackageFail += UpdatePackage;

            // Just get the complete list of names from map package listener
            RoutingPackageListener.OnPackageListUpdate += UpdateRoutingPackages;
            RoutingPackageManager.Start();

            RoutingPackageManager.Start();
            RoutingPackageManager.StartPackageListDownload();

            ContentView.Button.Click += OnMenuButtonClicked;
        }
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            PackageListener = new PackageListener();

            PackageListener.OnPackageCancel += UpdatePackage;
            PackageListener.OnPackageUpdate += UpdatePackage;
            PackageListener.OnPackageStatusChange += UpdatePackage;
            PackageListener.OnPackageFail += UpdatePackage;

            Manager.PackageManagerListener = PackageListener;
            Manager.Start();

            // Fetch list of available packages from server.
            // Note that this is asynchronous operation
            // and listener will be notified via onPackageListUpdated when this succeeds.
            Manager.StartPackageListDownload();

            Menu.List.AddRows(Manager.GetPackages());
            Menu.BackgroundClick += OnMenuBackgroundClicked;
            MenuButton.Click += OnMenuButtonClick;

            Menu.List.ListSource.CellActionButtonClicked += OnCellActionButtonClick;
        }