Exemple #1
0
 public WelcomeMenuViewModel()
 {
     singleSharedData   = SingletonSharedData.getInstance();
     apiHelperSingleton = new ApiHelper();
     //calling the getCustomers() method in the ApiHelper class to get Customers from DB
     MyCustomerList = apiHelperSingleton.getCustomers();
 }
Exemple #2
0
 public RegistrationViewModel()
 {
     sharedData             = SingletonSharedData.GetInstance();
     serverClient           = new ServerClient();
     RegisterAccountCommand = new Command(RegisterAccount);
     UsernameOnFocusCommand = new Command(UsernameOnFocus);
     GoToLoginCommand       = new Command(GoToLogin);
 }
Exemple #3
0
 public AddCustomerViewModel()
 {
     singleSharedData   = SingletonSharedData.getInstance();
     apiHelperSingleton = new ApiHelper();
     NewCustomer        = new Customer();
     ShowLabelName      = false;
     ShowLabelMail      = false;
 }
        public EventPopupViewModel(Event selectedEvent)
        {
            sharedData         = SingletonSharedData.GetInstance();
            serverClient       = new ServerClient();
            NavigateToMapCMD   = new Command(NavigateToMap);
            this.SelectedEvent = selectedEvent;

            SetupBinding();
            PopupNavigation.PopAllAsync();
        }
        /// <summary>
        /// Starts tracking in a new Thread
        /// </summary>
        private void StartService()
        {
            Thread thread = new Thread(() =>
            {
                SingletonSharedData sharedData = SingletonSharedData.GetInstance();
                sharedData.TrackingPoupViewModel.Track();
            });

            thread.Start();
        }
Exemple #6
0
        public LoginViewModel()
        {
            serverClient   = new ServerClient();
            sharedData     = SingletonSharedData.GetInstance();
            dataController = new DataController();

            LoginCMD            = new Command(Login);
            EntryFocusedCommand = new Command(EntryFocused);
            LoginClickedCMD     = new Command(Login);
        }
        public MapViewModel()
        {
            serverClient = new ServerClient();
            sharedData   = SingletonSharedData.GetInstance();

            StopFollowingCMD = new Command(StopFollowing);
            SetSpeedCMD      = new Command <String>(SetSpeed);
            PlayPauseCMD     = new Command(PlayPause);

            InitialSetup();
        }
        public MasterDetailViewModel()
        {
            sharedData     = SingletonSharedData.GetInstance();
            dataController = new DataController();
            serverClient   = new ServerClient();

            MenuItems = new ObservableCollection <MasterMenuItems>();

            LogOutCMD      = new Command(LogOut);
            HomeClickedCMD = new Command(HomeClicked);
            OnAppearing();
        }
        public ActionsViewModel()
        {
            sharedData      = SingletonSharedData.GetInstance();
            IsLockIDEnabled = true;

            LockIDFocusedCommand       = new Command(LockIDFocused);
            NavigateScannerViewCommand = new Command(NavigateScannerView);
            LockCommand            = new Command(Lock);
            UnlockCommand          = new Command(Unlock);
            ShareWithFriendCommand = new Command(ShareWithFriend);
            RemoveSharedCommand    = new Command(RemoveShared);
            serverClient           = new ServerClient();
            LockVisible            = true;
        }
 public LoginViewModel()
 {
     ((MasterDetailPage)Application.Current.MainPage).IsGestureEnabled = false;
     if (username != null)
     {
         Username = username;
     }
     if (Application.Current.Properties.ContainsKey("username"))
     {
         Username = Application.Current.Properties["username"].ToString();
     }
     LoginCommand            = new Command(Login);
     GoToRegisterPageCommand = new Command(GoToRegisterPage);
     OnEntryFocusedCommand   = new Command(OnEntryFocused);
     serverClient            = new ServerClient();
     sharedData = SingletonSharedData.GetInstance();
 }
        public MapViewModel()
        {
            try
            {
                serverClient = new ServerClient();
                sharedData   = SingletonSharedData.GetInstance();

                StopFollowingCMD = new Command(StopFollowing);
                SetSpeedCMD      = new Command <String>(SetSpeed);
                PlayPauseCMD     = new Command(PlayPause);

                InitialSetup();
            } catch (Exception e)
            {
                Console.WriteLine("mapviewmodel init error");
            }
        }
        public LoginViewModel()
        {
            try
            {
                serverClient   = new ServerClient();
                sharedData     = SingletonSharedData.GetInstance();
                dataController = new DataController();

                LoginCMD            = new Command(Login);
                EntryFocusedCommand = new Command(EntryFocused);
                LoginClickedCMD     = new Command(Login);
                ResetPasswordCMD    = new Command(ResetPassword);
            } catch (Exception e)
            {
                Console.WriteLine("LoginViewmodel init error");
            }
        }
Exemple #13
0
        public MasterDetailViewModel()
        {
            try {
                sharedData     = SingletonSharedData.GetInstance();
                dataController = new DataController();
                serverClient   = new ServerClient();

                MenuItems = new ObservableCollection <MasterMenuItems>();

                LogOutCMD      = new Command(LogOut);
                HomeClickedCMD = new Command(HomeClicked);
                OnAppearing();
            } catch (Exception e)
            {
                Console.WriteLine("masterdetailviewmodel init error");
            }
        }
        public TrackingPoupViewModel(TrackingEventViewModel trackingEventViewModel, TrackingEvent selectedEvent)
        {
            serverClient = new ServerClient();
            sharedData   = SingletonSharedData.GetInstance();

            sharedData.TrackingPoupViewModel = this;
            this.selectedEvent          = selectedEvent;
            this.trackingEventViewModel = trackingEventViewModel;

            SlideCompletedCMD = new Command(SlideCompleted);

            InitializeTrackingText();

            MessagingCenter.Subscribe <String>(this, "TrackingStopped", (value) =>
            {
                StopTracking();
            });
        }
Exemple #15
0
        private async Task InternalNavigateToAsync(Type viewModelType, object parameter)
        {
            Page page = CreatePage(viewModelType, parameter);

            var mpage = Application.Current.MainPage as MasterDetailPage;

            mpage.Detail = new NavigationPage(page);

            if (viewModelType == typeof(LoginViewModel))
            {
                SingletonSharedData sharedData = SingletonSharedData.GetInstance();

                page.BindingContext = new LoginViewModel();
            }
            else
            {
                await(page.BindingContext as BaseViewModel).InitializeAsync(parameter);
            }
        }
Exemple #16
0
 public DeleteCustomerViewModel()
 {
     singleSharedData   = SingletonSharedData.getInstance();
     apiHelperSingleton = new ApiHelper();
 }
Exemple #17
0
 public CreateUrlViewModel()
 {
     singleSharedData   = SingletonSharedData.getInstance();
     apiHelperSingleton = new ApiHelper();
 }
 public MapView()
 {
     InitializeComponent();
     Map.CustomPins = new List <CustomPin>();
     sharedData     = SingletonSharedData.GetInstance();
 }
 public CustomMapRenderer(Context context) : base(context)
 {
     sharedData   = SingletonSharedData.GetInstance();
     serverClient = new ServerClient();
 }
Exemple #20
0
 /// <summary>
 /// Gets the result of the scan and saves it to the SharedData class
 /// </summary>
 private async void OnScan()
 {
     SingletonSharedData.GetInstance().ScannedBikestandID = result.Text;
     await NavigationService.NavigateToAsync(typeof(ActionsViewModel));
 }