i encountered an issue when trying to bind controls to properties of a xpobject's child property.
the error occurs when the main xpobject is loaded and then a child property is changed.
xpo throws a sessionmixingexception when trying to assign a new value to the child property although they actually belong to the same session.
example:
there is an "Order" with a property "ResponsiblePerson" (typeof(Employee)). the order's view should habe some labels which display important data about this person. now i change the responsible person:
DoMagicStuff()
{
int key = SelectResponsiblePerson(); // ListBox, Form, whatever…
order.ResponsilbePerson = order.Session.GetObjectByKey<Employee>(key); // throws exception
}
the error does not occur when there are no controls bound to properties of CurrentOrder.ResponsilbePerson.
i attached a sample project to illustrate the problem.