Ejemplo n.º 1
0
        public BatchesViewModel()
        {
            m_addNewBatchCommand          = new RelayCommand <RecipeDataModel>(AddNewBatch, CanAddNewBatch);
            m_deleteBatchCommand          = new RelayCommand <BatchDataModel>(DeleteBatch);
            m_addGravityReadingCommand    = new RelayCommand(AddGravityReading, CanAddGravityReading);
            m_deleteGravityReadingCommand = new RelayCommand <GravityReadingDataModel>(DeleteGravityReading);

            List <Style> beerStyles = RecipeUtility.GetAvailableBeerStyles().OrderBy(style => style.Name).ToList();

            m_availableRecipes = new ObservableCollection <RecipeDataModel>(RecipeUtility.GetSavedRecipes(beerStyles));
            m_savedBatches     = new ObservableCollection <BatchDataModel>(BatchUtility.GetSavedBatches(m_availableRecipes));

            CurrentBatch = m_savedBatches.FirstOrDefault();
        }