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> /// Edit action /// </summary> public override void Edit() { var localEditWindow = new LocalEditWindow(this, SelectedLocal); localEditWindow.Show(); }
/// <summary> /// Add action /// </summary> public override void Add() { var localEditWindow = new LocalEditWindow(this, null); localEditWindow.Show(); }