I debugged the source code and found that it was because _leftContainer.Bounds and _rightContainer.Bounds were not calculated if they were not displayed before.
I modified ProcessSwipe as follows, then it works as expected.
private void ProcessSwipe(SwipeState state)
{
switch (state)
{
case SwipeState.RightVisible:
_rightContainer.IsVisible = true;
MaterializeDataTemplate(_rightContainer, Right);
SetTranslate(-_rightContainer.Bounds.Width);
break;
case SwipeState.LeftVisible:
_leftContainer.IsVisible = true;
MaterializeDataTemplate(_leftContainer, Left);
SetTranslate(_leftContainer.Bounds.Width);
break;
case SwipeState.Hidden:
default:
SetTranslate(0);
break;
}
}