Пример #1
0
        public MainViewModel()
        {
            //Singleton
            instance = this;

            //Create  observable collections
            Menu              = new ObservableCollection <MenuItemViewModel>();
            Customers         = new ObservableCollection <CustomerItemViewModel>();
            Properties        = new ObservableCollection <PropertyItemViewModel>();
            navigationService = new NavigationService();

            //Create views
            CurrentCustomer = new CustomerItemViewModel(0);

            NewCustomer = new CustomerItemViewModel(0);

            NewLogin = new LoginItemViewModel();

            CurrentProperty = new PropertyItemViewModel(0);

            NewProperty = new PropertyItemViewModel(0);
            //Insert services
            apiService = new ApiService();

            dataService = new DataService();

            netService = new NetService();

            //Load data
            LoadMenu();

            LoadCustomers();

            LoadProperties();
        }
Пример #2
0
        public void AddItem()
        {
            var ret = new PropertyItemViewModel()
            {
                ItemSource = Items, Parent = this, Name = "Property"
            };

            Items.Add(ret);
            SelectedItem = ret;
        }
Пример #3
0
 public void SetCurrentProperty(PropertyItemViewModel propertyItemViewModel)
 {
     CurrentProperty = propertyItemViewModel;
     PropertyUploadPhotoItemViewModel = new PropertyUploadPhotoItemViewModel(propertyItemViewModel.PropertyId);
 }