public LocalEditWindowViewModel(LocalsTabViewModel localTabViewModel, LocalEditWindow localEditWindow, Local local) : base(localTabViewModel, localEditWindow, local) { using (var con = new BaudiDbContext()) { BuildingsList = con.Buildings.ToList(); if (Update) { Local = con.Locals.Find(local.NotificationTargetID); SelectedBuilding = Local.Building; } else { Local = new Local(); } } }
/// <summary> /// Constructor /// </summary> /// <param name="localsTabViewModel">Locals tab view Model</param> /// <param name="local">Local</param> public LocalEditWindow(LocalsTabViewModel localsTabViewModel, Local local) { InitializeComponent(); DataContext = new LocalEditWindowViewModel(localsTabViewModel, this, local); }