Exemplo n.º 1
0
 public RecipeSetup()
 {
     // Create model instances
     process = new Process();
     ingredients = new Ingredients();
     Recipe = new General();
 }
Exemplo n.º 2
0
        // Constructor
        public UserActionViewModel()
        {
            // Create Models Instances
            ingredients = new Ingredients();

            // Create RelayCommand instances
            ProceedClickCommand = new RelayCommand(proceedClickCommand);

            // Create Timer instances
            UserActionAlarmTimer = new DispatcherTimer();

            // Registering to relevant messages
            Messenger.Default.Register<UserAlarm>(this, SetUserActionAlarm);
            Messenger.Default.Register<Ingredients>(this, Ingredients_MessageReceived);
        }
Exemplo n.º 3
0
 private void Ingredients_MessageReceived(Ingredients _ingredients)
 {
     ingredients = _ingredients;
 }
Exemplo n.º 4
0
        private void Ingredients_MessageReceived(Ingredients _ingredients)
        {
            // Assign received instance to local ingredients instance
            ingredients = _ingredients;
            
            // Format the data for display purposes
            // Malt Formating
            foreach(Ingredients.Malt malt in ingredients.Malts)
            {
                malt.Quantity = Math.Round(malt.Quantity, 2);
                malt.Quantity.ToString();
            }
            
            // Hop Formating
            foreach(Ingredients.Hop hop in ingredients.Hops)
            {
                hop.Quantity = Math.Round(hop.Quantity, 2);
                hop.Quantity.ToString();
            }

            // Yeast Formating

            ingredients.Yeast.MinTemp = Math.Round(ingredients.Yeast.MinTemp, 2);
            ingredients.Yeast.MaxTemp = Math.Round(ingredients.Yeast.MaxTemp, 2);

            ingredients.Yeast.MinTemp.ToString();
            ingredients.Yeast.MaxTemp.ToString();

            // Raise concerned properties
            RaisePropertyChanged(MaltsPropertyName);
            RaisePropertyChanged(HopsPropertyName);
            RaisePropertyChanged(YeastPropertyName);
        }
Exemplo n.º 5
0
        public SidePanelViewModel()
        {
            // List Initialisation
            recipe = new General();
            process = new Process();
            ingredients = new Ingredients();
            ingredients.Yeast.Name = "N/A";
            ingredients.Yeast.Type = "N/A";
            ingredients.Yeast.Form = "N/A";

            // Definition of Command Instances
            RecipeExpandCommand = new RelayCommand(recipeExpandCommand);
            ProcessExpandCommand = new RelayCommand(processExpandCommand);
            IngredientsExpandCommand = new RelayCommand(ingredientsExpandCommand);

            // Registration to messages
            Messenger.Default.Register<Process>(this, Process_MessageReceived);
            Messenger.Default.Register<Ingredients>(this, Ingredients_MessageReceived);
            Messenger.Default.Register<General>(this, Recipe_MessageReceived);
        }