public static void UpdateRecipe(this Recipe recipe, RecipiesViewModel recipeVm) { recipe.Name = recipeVm.Name; recipe.SellingPrice = recipeVm.SellingPrice; recipe.DesiredMargin = recipeVm.DesiredMargin; recipe.Ratio = recipeVm.Ratio; recipe.Description = recipeVm.Description; recipe.PlateCost = recipeVm.PlateCost; recipe.DesiredPlateCost = recipeVm.DesiredPlateCost; recipe.Difference = recipeVm.Difference; recipe.ActualMargin = recipeVm.ActualMargin; recipe.Margin = recipeVm.Margin; }
public MainViewModel() { Settings = new SettingsViewModel(this); Consumables = new ConsumablesViewModel(this); Recipies = new RecipiesViewModel(this); Plan = new PlanViewModel(this); Shopping = new ShoppingListViewModel(this, Plan); if (Directory.Exists(Settings.TempPath)) { foreach (var file in Directory.GetFiles(Settings.TempPath)) { File.Delete(file); } } }