Exemplo n.º 1
0
        public AppointmentViewModel(
            IMedicalSpecializationDataService medicalSpecializationDataService,
            IBuildingDataService buildingDataService,
            IProfileDataService profileDataService,
            ISuggestionProvider geoSuggestionProvider,
            IEventAggregator eventAggregator)
        {
            this.MedicalSpecializationDataService = medicalSpecializationDataService;
            this.GeoSuggestionProvider            = geoSuggestionProvider;
            this.BuildingDataService = buildingDataService;
            this.ProfileDataService  = profileDataService;
            this.EventAggregator     = eventAggregator;

            this.PageContract = new PageControlContract(default(int), this.MedicalSpecializationDataService);

            this.PageSizes = new ObservableCollection <int> {
                2, 10, 20, 50, 100, 200
            };

            this.LoadedCommand             = AsyncCommand.Create(this.OnLoadedAsync);
            this.OpenSpecializationCommand = new RelayCommand(
                parameter =>
            {
                var args = (List <int>)parameter;
                this.EventAggregator.GetEvent <OpenSpecializationDoctorsEvent>().Publish(
                    new OpenSpecializationDoctorsArgs {
                    PolyclinicId = args[1], SpecializationId = args[0], ParentViewModel = this
                });
            });
        }
        public CreateProfileViewModel(ISuggestionProvider geoSuggestionProvider, IProfileDataService profileService, IBuildingDataService buildingService, IDialogCoordinator dialogCoordinator, IFileDialogCoordinator fileDialogCoordinator)
        {
            this.GeoSuggestionProvider = geoSuggestionProvider;
            this.ProfileService        = profileService;
            this.BuildingService       = buildingService;
            this.DialogCoordinator     = dialogCoordinator;
            this.FileDialogCoordinator = fileDialogCoordinator;

            this.Profile = new ProfileWrapper(new Profile
            {
                DateOfBirth = DateTime.Now
            });

            this.Address = new AddressWrapper(new Address());

            this.AddPhotoCommand      = new RelayCommand(this.OpenPhotoAsBytes);
            this.ValidateCommand      = AsyncCommand.Create(this.ValidateAsync);
            this.CreateProfileCommand = AsyncCommand.Create(this.CreateAndSaveProfileAsync);
        }