Exemple #1
0
        private void StartDetecting()
        {
            IsDetecting = true;
            var vehicleId = ApplicationDataRepository.GetOptionalIntegerFromApplicationData(CameraViewVehicleIdKey, 0);

            loadVehicleTask = MyShuttleClient.VehiclesService.GetAsync(vehicleId.Value);
        }
        public ViewModelBase()
        {
            _dataRepository = new ApplicationDataRepository();

            _settings        = new ApplicationSettingServiceSingleton(_dataRepository);
            _locationService = new LocationServiceSingleton(_settings);
            CoreClient       = new CoreClient(_settings, new ApplicationStorageService(_dataRepository));
        }
        protected override void OnLaunched(LaunchActivatedEventArgs args)
        {
            Frame rootFrame = Window.Current.Content as Frame;

            //app defualts to application data storage
            //change the  UseApplicationStorage = false for Jet Datastorage
            UseApplicationStorage = true;
            IDataRepository dr = null;

            if (UseApplicationStorage)
            {
                dr = new ApplicationDataRepository();
            }
            else
            {
                dr = new JetDataRepository();
            }
            dr.CreateInstance();
            App.PasswordDB = dr;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                if (!rootFrame.Navigate(typeof(MainPage), args.Arguments))
                {
                    throw new Exception("Failed to create initial page");
                }
            }
            // Ensure the current window is active


            Window.Current.Activate();
        }
        public BaseTabbedViewModel(Page currentPage)
            : base(currentPage)
        {
            Tab1Click();
            SetPdf();
            Tab1Command = new Command(Tab1Click);
            Tab2Command = new Command(Tab2Click);

            _dataRepository = new ApplicationDataRepository();

            _settings = new ApplicationSettingServiceSingleton(_dataRepository);
            _locationService = new LocationServiceSingleton(_settings);
            CoreClient = new CoreClient(_settings,new ApplicationStorageService(_dataRepository));
        }
Exemple #5
0
        public BaseTabbedViewModel(Page currentPage) : base(currentPage)
        {
            Tab1Click();
            SetPdf();
            Tab1Command = new Command(Tab1Click);
            Tab2Command = new Command(Tab2Click);


            _dataRepository = new ApplicationDataRepository();

            _settings        = new ApplicationSettingServiceSingleton(_dataRepository);
            _locationService = new LocationServiceSingleton(_settings);
            CoreClient       = new CoreClient(_settings, new ApplicationStorageService(_dataRepository));
        }