예제 #1
0
        public DishAddViewModel(IControllerFactory factory, ICategorySubject subject)
        {
            this.factory = factory;
            this.dish    = new DishAddDTO();

            this.SaveCommand = new DelegateCommand(Save, CanSave);

            this.Categories = new ObservableCollection <CategoryDisplayDTO>();

            subject.Subscribe(this);
            Update();
        }
예제 #2
0
        public CategoryListViewModel(IControllerFactory factory, ICategorySubject subject)
        {
            this.factory = factory;
            subject.Subscribe(this);

            this.SelectCommand = new DelegateCommand(
                () => RaiseCategorySelectedEvent(Category),
                obj => Category != null);

            this.Categories = new ObservableCollection <CategoryDisplayDTO>();

            Update();
        }