public void OnChildAdded(DataSnapshot snapshot, string previousChildName) { WorkspaceModel created = new WorkspaceModel(parent.workspacesReference.Child(snapshot.Key), snapshot); int index_in = parent.workspaces.FindIndex(v => v.Id == previousChildName); ++index_in; parent.workspaces.Insert(index_in, created); parent.mainLayout.AddView(created.GetView(parent).GetView(), index_in); }