Ejemplo n.º 1
0
 public ShowImageViewModel(ShowImagePage showImagePage, BaseViewModel parent)
 {
     Title = "Foto anzeigen";
     this.showImagePage    = showImagePage;
     this.Parent           = parent;
     protocolMethodService = new ProtocolMethodService();
     taskService           = new TaskService();
     if (Parent is ShowProtocolMethodViewModel viewModel)
     {
         protocolMethodService.LoadImage(viewModel.Model);
         if (viewModel.Model.Image != null)
         {
             var stream = new MemoryStream(viewModel.Model.Image);
             image = ImageSource.FromStream(() => stream);
             OnPropertyChanged(nameof(Image));
         }
     }
     if (Parent is ShowTaskViewModel taskviewModel)
     {
         taskService.LoadImage(taskviewModel.Model);
         if (taskviewModel.Model.Image != null)
         {
             var stream = new MemoryStream(taskviewModel.Model.Image);
             image = ImageSource.FromStream(() => stream);
             OnPropertyChanged(nameof(Image));
         }
     }
 }
 public ShowProtocolMethodViewModel(ShowProtocolMethodPage showProtocolMethodPage, ProtocolMethod model)
 {
     Title = "Durchgeführte Methode";
     this.showProtocolMethodPage = showProtocolMethodPage;
     this.model            = model;
     imageCommand          = new Command(o => OpenImage());
     showCommand           = new Command(o => ShowImage());
     safeCommand           = new Command(o => Safe());
     protocolMethodService = new ProtocolMethodService();
 }
Ejemplo n.º 3
0
 public ImageViewModel(ImagePage imagePage)
 {
     Title                 = "Fotoverwaltung";
     this.imagePage        = imagePage;
     addImage              = new Command(o => AddImageFromGallery());
     safeImage             = new Command(o => SafeImage());
     protocolMethodService = new ProtocolMethodService();
     taskService           = new TaskService();
     takeImageCommand      = new Command(o => TakeImage());
 }
 public ProtocolMethodOverviewViewModel(ProtocolMethodOverviewPage protocolPage)
 {
     IsBusy = true;
     OnPropertyChanged(nameof(IsBusy));
     Title = "Methodenübersicht";
     createMethodCommand        = new Command(o => CreateMethod());
     this.protocolPage          = protocolPage;
     this.protocolMethodService = new ProtocolMethodService();
     this.protocolService       = new ProtocolService();
     this.methodService         = new MethodService();
     RefreshList();
 }
        public CreateProtocolMethodViewModel(CreateProtocolMethodPage createProtocolMethodPage)
        {
            Title = "Methode durchführen";
            this.createProtocolMethodPage = createProtocolMethodPage;
            this.methodService            = new MethodService();
            this.protocolService          = new ProtocolMethodService();
            this.teamService = new TeamService();
            imageCommand     = new Command(o => OpenImage());
            safeCommand      = new Command(o => SafeMethod());
            rooms            = new ObservableCollection <string>();
            rooms.Add("Problem");
            rooms.Add("Lösung");
            rooms.Add("Implementierung");
            thinkingTypes = new ObservableCollection <string>();
            thinkingTypes.Add("Divergent");
            thinkingTypes.Add("Konvergent");

            methods = new ObservableCollection <Method>(methodService.GetAll());
        }