Esempio n. 1
0
 public AddShapeCommand(
     IShapeViewModelFactory shapeViewModelFactory,
     ObservableCollection <ShapeViewModel> shapes)
 {
     _shapeViewModelFactory = shapeViewModelFactory;
     _shapes = shapes;
 }
        public ShapesViewModel(IShapeRepository shapeRepo,
                               IComputeAreaService computeAreaService,
                               ISubmissionService submissionService,
                               IUserInteraction userInteraction,
                               IShapeViewModelFactory shapeViewModelFactory)
        {
            _ShapeRepo             = shapeRepo;
            _ComputeAreaService    = computeAreaService;
            _SubmissionService     = submissionService;
            _UserInteraction       = userInteraction;
            _ShapeViewModelFactory = shapeViewModelFactory;

            ShapeListItems = new ObservableCollection <ShapeListItemViewModel>();

            AddShapeCommand    = new MvxCommand(AddShape);
            RemoveShapeCommand = new MvxCommand(RemoveSelectedShape);
            ComputeAreaCommand = new MvxCommand(ComputeTotalArea);
            SubmitAreaCommand  = new MvxCommand(SubmitArea);
        }