Probably, it's not possible with Mode=OneWayToSource. To make it automatic, what I've done is: first removed the Mode:
<cc:ComboField Grid.Row="1" Label="Space"
Source="{Binding VacantSpaces}"
Display="Name"
SelectedValuePath="Id"
SelectedValue="{Binding NewObject.SpaceId}"/>
now, after the execution of renewNewObject function, the combobox's SelectedItem becomes null so to remove the null from ComboBox, I've to move CurrentItem manually in Combo's OnItemsChanged:
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
{
switch (e.Action)
{
...
case NotifyCollectionChangedAction.Remove:
case NotifyCollectionChangedAction.Reset:
if (e.NewItems == null && !Items.IsEmpty)
Items.MoveCurrentToFirst();
break;
}
}
I'd that in Reset before because CurrentItem remains null when Plots/Spaces.IsEmpty return false, now I've to have that in Remove as well!