public WorkspaceService() { List <Workspace> workspaces = ServiceHolder.GetService <JSONUtilsService>().Deserialize <List <Workspace> >(Workspace.FILE_PATH) ?? new List <Workspace>(); foreach (var ws in workspaces) { ws.OnSlavesChanged += Workspace_OnSlavesChanged; WorkspaceViewModel vm = new WorkspaceViewModel(ws); Workspaces.Add(ws, vm); } }
private void Workspace_OnSlavesChanged(object sender) { ServiceHolder.GetService <JSONUtilsService>().Serialize(Workspace.FILE_PATH, sender); }