public LocationEdit(SelectedLocationViewModel viewModel)
        {
            InitializeComponent();

            BindingContext = this.viewModel = viewModel;
            var database = new SQLiteConnection(path2);

            Tenants = new ObservableCollection <Tenant>();

            var tenants = database.Table <Tenant>().OrderBy(x => x.Id).ToList();

            foreach (Tenant tenant in tenants)
            {
                Tenants.Add(tenant);
            }
            Tenant vacant = new Tenant();

            {
                vacant.FirstName          = "Vacant";
                vacant.LastName           = "Property";
                vacant.SecondaryFirstName = "Empty";
                vacant.SecondaryLastName  = "Building";
                vacant.Image        = "/Assets/Icon-72.png";
                vacant.EmailAddress = "N/A";
                vacant.PhoneNumber  = "N/A";
                vacant.Id           = 100000;
            }
            Tenants.Add(vacant);
            TenantPicker.ItemsSource = Tenants;
        }
Example #2
0
        public LocationView()
        {
            InitializeComponent();

            BindingContext = viewModel = new SelectedLocationViewModel();

            if (LATITUDE.Text == "0" || LONGITUDE.Text == "0")
            {
                NAVIGATE.IsVisible = false;
                NAVIGATE.IsEnabled = false;
            }
        }
        public LocationEdit()
        {
            InitializeComponent();

            BindingContext = viewModel = new SelectedLocationViewModel();
            var database = new SQLiteConnection(path2);

            Tenants = new ObservableCollection <Tenant>();

            var tenants = database.Table <Tenant>().OrderBy(x => x.Id).ToList();

            foreach (Tenant tenant in tenants)
            {
                Tenants.Add(tenant);
            }

            TenantPicker.ItemsSource  = Tenants;
            TenantPicker.SelectedItem = TenantPicker.Items[TenantPicker.SelectedIndex].LastOrDefault().ToString();
        }